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

merge main in feature/http_api #12

Merged
merged 16 commits into from
Mar 15, 2024
Merged

merge main in feature/http_api #12

merged 16 commits into from
Mar 15, 2024

Conversation

jkhsjdhjs
Copy link

@jkhsjdhjs jkhsjdhjs commented Mar 6, 2024

This PR should be merged after eclipse-basyx#249 and eclipse-basyx#251 have been merged, as the HTTP API can make use of this new functionality.

Replace a block of text by an `attention` admonition to highlight it
properly. Furthermore, add a missing comma.
...so that it can be used by the HTTP API.
@jkhsjdhjs jkhsjdhjs marked this pull request as draft March 13, 2024 22:50
The respective exception marks an error in the program, which should
correctly be an `AssertionError`.
`GlobalReference` has been renamed to `ExternalReference` in V3, but
this enum member has been missed in the rename.
lxml supports paths already, no modification is necessary there.
However, the `lxml.etree.ElementTree.write()` function requires
`BinaryIO`, i.e. files opened with the 'b' mode. While it would be
possible to access the underlying binary buffer of files opened in text
mode via `open()`, this isn't possible for `io.StringIO()`, as it
doesn't have the `buffer` property. Thus, even if we could support files
opened via `open()` in text mode, we couldn't annotate the XML
serialization functions with `TextIO`, as `io.StringIO()` remains
unsupported. Because of that, I decided to not support `TextIO` for the
XML serialization.

The builtin JSON module only supports file handles, with the
`json.dump()` method only supporting `TextIO` and `json.load()`
supporting `TextIO` and `BinaryIO`. Thus, the JSON adapter is modified
to `open()` given paths, while the JSON serialization is additionally
modified to wrap `BinaryIO` with `io.TextIOWrapper`.

Fix #42
... by using `StringIO` instead of `BytesIO`.
Resolution of id_short paths is added via
`UniqueIdShortNamespace.get_referable()`, such that it can be used on
every object, that spans such a namespace. `ModelReference.resolve()`
is simplified to make use of this new functionality. Furthermore,
tests for this are added.
Show the object, where the resolution failed, in the error messages.
@jkhsjdhjs jkhsjdhjs marked this pull request as ready for review March 15, 2024 11:09
@jkhsjdhjs jkhsjdhjs merged commit 107f158 into feature/http_api Mar 15, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant