-
Notifications
You must be signed in to change notification settings - Fork 11
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
Using AnyOf makes the OpenAPI generator server fail #148
Comments
Interesting behaviour here. It works for the Restrictions example, but when I use my more complex ontology, it fails to generate AnyOf in the yaml. If I manually edit the openapi.yaml file to add the AnyOf, it builds and runs the server fine. |
Note that the issue here is not because there is no anyOf in the YAML spec, (for the example I tried it worked fine for me). The issue is that the OpenAPI generator will not produce the class for the anyOf union, and the server will fail. This is due to OpenAPI generator, but we should offer a solution. If you face a problem with anyOf not being generated as part of the spec, please open an issue, as we will need to fix it. |
TO DO : Test if this behavior occurs with OneOf |
Workaround solution discussed with @hvarg: until OpenAPI generator is fixed, we will create a placeholder python class for representing unions (and possibly intersections) of classes. This way the API will work successfully (for these items only a type, label an id are returned, so it will be fine). |
I'll try and create a reproducer for this bug. It seems to work sometimes and not other times. Works with the Restrictions example, but not my ontology. At present I manually modify the config.yaml file to add back in the anyOf. |
If you manage to reproduce, can you please open a separate issue?
Converting anyOf should be covered by the mapping.
El mié., 4 nov. 2020 11:02 p. m., Dougal Watt <[email protected]>
escribió:
… I'll try and create a reproducer for this bug. It seems to work sometimes
and not other times. Works with the Restrictions example, but not my
ontology. At present I manually modify the config.yaml file to add back in
the anyOf.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#148 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALTIGR2SCPUQAPYUQU6CELSOJEZNANCNFSM4TDEWAVQ>
.
|
It looks like while AnyOf is supported by OpenAPI spec, it does not work well in the OpenAPI generator server we are using.
Solution:
Better solution: Open an issue in OpenAPI generator and wait until they fix it.
The text was updated successfully, but these errors were encountered: