dataverse icon indicating copy to clipboard operation
dataverse copied to clipboard

Swagger Dataverse API issue: openapi file

Open sirineREKIK opened this issue 2 years ago • 2 comments

Hello,

We found that the openapi file is not valid. We fixed the yaml file hoping it would work, but still not. You can find the corrected yaml file attached: openapi_fixed.yml.zip

you can also use these 2 tools to test the validity of the file : https://redocly.com/redocly-cli/ or https://github.com/IBM/openapi-validator

By doing analysis we estimate that the problem comes from the yaml descriptor: we suspect an infinite loop at the component level, because there are LOTS of them, and when trying to display the structure of a response from an endpoint it crashes.

sirineREKIK avatar May 24 '23 09:05 sirineREKIK

Would this be solved by

  • #10328 ?

DS-INRAE avatar Mar 28 '24 10:03 DS-INRAE

Probably. @DS-INRA and @sirineREKIK you're welcome to jump into the ongoing discussion at https://dataverse.zulipchat.com/#narrow/stream/379673-dev/topic/.2Fopenapi.20broken.20in.206.2E0

pdurbin avatar Mar 28 '24 13:03 pdurbin

I was able to run both tools on DV the develop branch and also from 5.9 so I was not able to reproduce the crash of the application.

Regarding the results:

Develop OpenAPI:

IBM:

Summary:
  Total number of errors   : 650
  Total number of warnings : 5824

Redocly

< ... 1391 more problems hidden > increase with `--max-problems N`
openapi.yaml: validated in 206ms

❌ Validation failed with 957 errors and 534 warnings.
run `reduced lint --generate-ignore-file` to add all problems to the ignore file.

5.9 Open API

IBM:

Summary:
  Total number of errors   : 502
  Total number of warnings : 5567

Redocly

< ... 1093 more problems hidden > increase with `--max-problems N`
openapi.yaml: validated in 167ms

❌ Validation failed with 804 errors and 389 warnings.
run `redocly lint --generate-ignore-file` to add all problems to the ignore file.

In conclusion:

We are aware that the OpenAPI specification needs a LOT of work and some of this may even require the refactoring of several endpoints and some breaking changes, we need to do a spike to identify the next steps and start working on improving the OpenAPI document.

Also, we can see that each tool (we also use https://quobix.com/vacuum/ ) has a different set of metrics to evaluate what is an error and what is a warning, none of the numbers are consistent between the 3 options.

jp-tosca avatar Jun 14 '24 15:06 jp-tosca

In Zulip @luddaniel said we can go ahead and close this.

As discussed there this issue was opened by a former colleague of his. @luddaniel or others will open smaller issues that we can hopefully fit into a sprint so that we can make progress getting the error count down over time.

pdurbin avatar Jun 14 '24 16:06 pdurbin

Thanks for the update @jp-tosca !

The "crash" mention on the issue reference a tool who display a UI, like Swagger Editor. Now, base on develop branch, I can display the documentation.

jeromeroucou avatar Jun 14 '24 16:06 jeromeroucou