Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong value only submodel-element serialization #995

Closed
sirchnik opened this issue Jan 4, 2025 · 2 comments
Closed

Wrong value only submodel-element serialization #995

sirchnik opened this issue Jan 4, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@sirchnik
Copy link

sirchnik commented Jan 4, 2025

Description

While comparing with Eclipse Basyx, I noticed that value only serialization deviates from spec in Faaast-service. As '/submodel/submodel-elements/{idShortPath}/$value' should return SubmodelElementValue which defines PropertyValue-serialization as JSON primitives.

Reproduction

Faaast-service: v1.2.0 MongoDB
Basyx 2.0 Milestone 4

submodel creation ```bash curl -X POST \ -H "Content-Type: application/json" \ -d '{ "idShort": "a", "id": "https://admin-hell.io/a", "kind": "Instance", "submodelElements": [ { "idShort": "b", "value": [ { "idShort": "c", "valueType": "xs:long", "value": 0, "modelType": "Property" } ], "modelType": "SubmodelElementCollection" } ], "modelType": "Submodel" }' \ http://localhost:8080/api/v3.0/submodels ```
curl 'http://localhost:8080/api/v3.0/submodels/aHR0cHM6Ly9hZG1pbi1oZWxsLmlvL2E/submodel-elements/b.c/$value?level=core'

Expected

0

Basyx returns "0" as a string which has already reported in their repo.

Output

{
  "c" : 0
}

Additional Context

  • I am reporting this issue solely for testing purposes, as I am currently verifying which AAS implementations are functioning. Therefore, I don't need a fix at this time.
  • I am also no expert I just wanted to provide feedback.
@sirchnik sirchnik added the bug Something isn't working label Jan 4, 2025
@mjacoby
Copy link
Member

mjacoby commented Jan 7, 2025

Your observations are correct. However, to be precise, this is not considered a bug since v3.0.x of the specification is underdefined regarding valueOnly serialization stating only the following about valueOnly serialization of properties

image

But this is only valid for serialization of properties within a submodel. For serialization of properties that are not part of a submodel (as in your example) no definition is given.

This is fixed in the upcoming v3.1 version of the AAS specification (https://admin-shell-io.github.io/aas-specs-antora/IDTA-01001/v3.1/mappings/mappings.html#value-only-serialization-in-json)

The following rules shall be adhered to when serializing a single submodel element with the format "Value":
   Property is serialized as ${Property/value} where ${Property/value} is serialized as described above.

This will be updated in future releases of FA³ST, i.e., FA³ST will also return 0 instead of { "c": 0 } in the future.

@sirchnik
Copy link
Author

sirchnik commented Jan 7, 2025

Okay thanks for the info.
I think this issue can be closed with this.

@sirchnik sirchnik closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants