Repository navigation
Conversation
Contributor
|
@thammel please resolve conflicts |
thammel
force-pushed
the
feat/446-get-value-endpoints
branch
from
October 8, 2026 09:54
4413c62 to
5f785c6
Compare
All `$value` routes previously responded with `501 Not Implemented`.
The specification leaves some points open, which are resolved as
follows:
- Property values are mapped to the JSON type of their `valueType`, so
booleans and numbers are not quoted. Values without a JSON literal
are returned as their XSD representation.
`xs:integer` is unbounded in both Python and JSON and is
therefore passed on as it is.
- Elements without a value are omitted from Submodels, collections and
Entity statements, but kept as `null` within a SubmodelElementList, as
omitting them would shift the indices of the remaining elements.
- Operations and Capabilities have no ValueOnly representation. They are
skipped in containers and result in `400 Bad Request` when requested
directly, which is how the `$metadata` route handles them.
- `level=core` returns the direct children of the requested resource and
their nested containers as empty, matching the examples of the
specification.
- The entries of `GET /submodels/{id}/submodel-elements/$value` are
mapped by idShort, as a bare `SubmodelElementValue` would lose the
association between a value and its element. Submodels are returned
as-is, since their entries are already named.
- The languages of a MultiLanguageProperty are sorted, to keep the order
of the response deterministic.
The ValueOnly serialization is only defined for JSON, so the routes
respond with `406 Not Acceptable` if XML is requested. `extent` remains
unimplemented, as on all other routes. `PATCH …/$value`, the `$path`
routes and the operation invocation routes are not part of this change.
Fixes eclipse-basyx#446
thammel
force-pushed
the
feat/446-get-value-endpoints
branch
from
October 8, 2026 09:55
5f785c6 to
d6ed40f
Compare
Contributor
|
@hpoeche could you review this? |
Contributor
s-heppner
marked this pull request as draft
October 20, 2026 12:43
Member
|
Will probably be solved in #660, so we currently keep this for reference and will close once no longer needed. |
Member
|
Will be done in #660 |
s-heppner
pushed a commit
that referenced
this pull request
Nov 23, 2026
Previously, the SDK lacked the JSON serialization formats "Metadata", "ValueOnly" and "Path" of [IDTA-01001]. The `StrippedAASToJsonEncoder` implemented a format that matched none of them (#651). Therefore, the server responded with `501 Not Implemented` on `/$value` and `/$path`, ignored `?extent` and misinterpreted `/$metadata` and `?level=core` (#650, #651). Additionally, unordered JSON arrays had no defined order, so equal objects could result in different JSON strings (#573). Finally, elements of a `SubmodelElementList` never serialized their `idShort`, even when it was set manually. Changes in the SDK: - The new subpackage `adapter.json.formats` offers an encoder for every serialization format: `MetadataJsonEncoder`, `ValueOnlyJsonEncoder`, `ReferenceJsonEncoder` and `PathJsonEncoder`. All of them subclass `AASToJsonEncoder`. - `AASToJsonEncoder` gets the init argument `deep` for `level=core` and the class attribute `with_blob_value` for `extent=WithoutBLOBValue` of [IDTA-01002]. - Unordered collections are serialized in a canonical order, defined in `adapter._ordering`, and `modelType` is always the first key of a `Referable`. - Elements of a `SubmodelElementList` serialize their `idShort` in JSON and XML, unless it was generated. - In ValueOnly, `xs:decimal` values are rounded to the nearest IEEE double. This is tracked in #694. Changes in the server: - `app.adapter.modifiers` parses the modifiers centrally and selects the matching encoder. The Submodel Repository GET routes support all content modifiers, `level` and `extent`. Combinations that [IDTA-01002] does not allow are rejected with `400 Bad Request`. - Operations and Capabilities have no ValueOnly or Metadata representation. They are omitted from listings. Requesting them, or a `SubmodelElementList` of them, returns `400 Bad Request`. - In ValueOnly, elements without a value are omitted, except in a `SubmodelElementList`, where they are kept as `null` to preserve the indices. - `GET .../submodel-elements/$value` returns one object with the idShorts as names. `/submodels/$value` follows the corrected version of the API specification ([admin-shell-io/aas-specs-api#713]). - The idShortPaths of `$path` start with the idShort of the requested element. Therefore, an element of a `SubmodelElementList` without an `idShort` has no Path representation (`400 Bad Request`). This changes existing behavior: - Normal JSON responses of the Submodel Repository omit `Blob` values unless `?extent=WithBLOBValue` is given, since the specification defines `WithoutBLOBValue` as the default. - XML only supports `$reference` and the Normal serialization with `level=deep` and `extent=WithBLOBValue`. Any other combination, including a request without `?extent=WithBLOBValue`, is rejected with `406 Not Acceptable`. This breaks existing clients. - `?level=core` on `/shells` and `/concept-descriptions` is rejected with `400 Bad Request`. - `?limit=0` is rejected with `400 Bad Request`. #650 and #651 are fixed for GET requests only. PATCH requests are still wrong. This contribution was written with the help of Claude Opus 5.5. Fixes #446 Fixes #573 Fixes #621 Fixes #623 Fixes #643 Fixes #644 Fixes #649 [IDTA-01001]: https://industrialdigitaltwin.io/aas-specifications/IDTA-01001/v3.1.2/mappings/mappings.html [IDTA-01002]: https://industrialdigitaltwin.io/aas-specifications/IDTA-01002/v3.1.1/specification/interfaces-operation-parameters.html#SerializationModifier [admin-shell-io/aas-specs-api#713]: admin-shell-io/aas-specs-api#713
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All
$valueroutes previously responded with501 Not Implemented.The specification leaves some points open, which are resolved as follows:
valueType, so booleans and numbers are not quoted. Values without a JSON literal are returned as their XSD representation.xs:integeris unbounded in both Python and JSON and is therefore passed on as it is.nullwithin a SubmodelElementList, as omitting them would shift the indices of the remaining elements.400 Bad Requestwhen requested directly, which is how the$metadataroute handles them.level=corereturns the direct children of the requested resource and their nested containers as empty, matching the examples of the specification.GET /submodels/{id}/submodel-elements/$valueare mapped by idShort, as a bareSubmodelElementValuewould lose the association between a value and its element. Submodels are returned as-is, since their entries are already named.The ValueOnly serialization is only defined for JSON, so the routes respond with
406 Not Acceptableif XML is requested.extentremains unimplemented, as on all other routes.PATCH …/$value, the$pathroutes and the operation invocation routes are not part of this change.Fixes #446