-
Notifications
You must be signed in to change notification settings - Fork 45
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
lost in OpenAPI validation errors / code generation #390
Comments
Hi @arneschilling , In theory, the OpenAPI description examples should validate in Swagger, but there may be some small issues causing errors. I have ran into issues with recursive references in the past in particular. I suggest that the SWGs look at the state of the OpenAPI example definition on the official schemas for Part 1 at the earliest opportunity (we probably meet next Monday morning). In the meantime, you may also look at the latest draft API definition at: https://github.com/opengeospatial/ogcapi-processes/tree/master/openapi which may be in a better or worst state (there is at least one open issue ( #370 ) assigned to me about that one). We also have an OpenAPI definition that does validate with Swagger for our implementation which is one the two reference implementations: https://maps.gnosis.earth/ogcapi/api And the other GeoLabs reference implementation validates successfully as well: http://tb17.geolabs.fr:8119/swagger-ui/oapip/ so you way want to compare the API definitions with that. If you figure out what is wrong with the example 1.0 schemas before we do, feedback on what needs to be fixed here would be welcomed. I agree we should have something easy to use. We will try to address the issue and/or provide better guidance on how to use it ASAP. Thank you! -Jerome |
We use SwaggerHub and Swagger Editor to validate conformance to the OpenAPI 3 specification. Swagger Editor reports the API definition document as valid. I did however need to change the referenced URIs from Please note that once the referenced URIs have been changed to https, the apitools.dev validator also reports the API definition document as valid...but that the validator cannot display it because of circular references. See the attached screenshot. |
@ghobona , what is the source of the content in your seconds screenshot? File https://schemas.opengis.net/ogcapi/processes/part1/1.0/openapi/ogcapi-processes-1.yaml has an invalid character in line 3 (colon). After removing it, I get more errors: |
@arneschilling The reason is the browser-based application is running at https level, whereas the imports in the file are at http level. To fix the issue, in the file itself, select all |
Some issues might relate to #371 as well. |
I will share a little gradle project using the org.openapi.generator plugin. The setup is rather simple:
|
@arneschilling This comment does not really offer a solution, but hopefully it will offer some insight into previous discussion on code generators. Testbed-17 experimented with code generators and reported on the outcomes here. |
The example has been updated so that all of the imports/references now use https URLs. |
@ghobona @arneschilling Is this issue resolved now? If yes, please close it. Thanks! |
SWG meeting from 2024-08-05: @pvretano will follow up on this issue. |
At NASA JPL, we are attempting to utilize this repo's OpenAPI specification for the OGC Processes API. This issue is making it incredibly difficult to create an implementation of the API. |
@arneschilling @drewm-jpl There is a note about code generators and their limitations in this OGC Testbed-17 engineering report. See sections 7.5.1 and 8. We were subsequently able to address some of the issues by publishing the schemas bundled into a single example OpenAPI definition file, as an additional resource for developers. An example of such a file is on SwaggerHub. @pvretano can provide further advice. |
Hi,
according to the OpenAPI Validator on
https://apitools.dev/swagger-parser/online/
the official yaml schema from
https://schemas.opengis.net/ogcapi/processes/part1/1.0/openapi/ogcapi-processes-1.yaml
is invalid. What do you think about it?
I could not find any tool for generating code from the OpenAPI apecification that works. All Tools seem to use swagger model and produce errors like this one
-Cannot invoke "io.swagger.v3.oas.models.media.Schema.get$ref()" because "items" is null
No code is generated because the model validation fails.
no hint given anywhere where to look for an error
I tried the openApiGenerate gradle task as well al the nvm cli package, but were not able to produce any results.
I also tried the schema found in the 1.0.0-maintenance tag of this repo, same problems here.
What exactly do you expect from software developers? Is there any recommended way how to exploit the benefits of an OpenAPI description as to automatic code generation?
best regards,
Arne
The text was updated successfully, but these errors were encountered: