-
Notifications
You must be signed in to change notification settings - Fork 121
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
Library XML deserializer doesn't include annotations #931
Labels
Comments
The annotations work for JSON because of an opposite bug: |
I noticed that in some cases Jackson generates an empty string as
This breaks the expectations of the TranslatorOptionsUtil, triggering:
The solution is perhaps to check for empty strings on TranslatorOptionsUtil.parseTranslatorOptions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When deserializing an XML ELM library the annotations are omitted and you get null instead. This makes it impossible to check for valid translator options on an XML ELM library, among other things.
There is schema in the project for cqlannotations here:
https://github.com/DBCG/cql_engine/blob/develop/engine/src/main/resources/cql-lm/schema/elm/cqlannotations.xsd
However, that schema is never run through code-gen and there no classes are generated for it:
https://github.com/DBCG/cql_engine/blob/develop/engine/pom.xml#L95
The JAXB deserializer is not configured to know how deserialize those nonexistent classes. The Jackson deseralizer automatically maps the annotations to a HashMap so it does preserve the annotations, albeit in a JSON-y format.
The ELM deseralizer regression suite only checks for exceptions and not the validity of the resulting libraries. There are no tests for the presence of annotations. The regression suite also does only a basic comparison of the results of the JSON and XML deseralizers, so the the fact that the JSON libraries are good and the XML libraries are bad is not detected:
https://github.com/DBCG/cql_engine/blob/develop/engine/src/test/java/org/opencds/cqf/cql/engine/execution/ElmTests.java#L137
So, we need to:
The text was updated successfully, but these errors were encountered: