question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Validation of OpenAPI Spec?

See original GitHub issue

I think we started a discussion somewhere about this, but I could not find it.

Maybe at API level we could defines an interface to report OpenAPI validation issues.


Example of an invalid spec:

 OASFactory.createSchema()
   .ref("#/components/schemas/SomeObj")
   .type(Schema.SchemaType.OBJECT) // Wrong value because "$ref" is present
   .description("The hello type") // Wrong value because "$ref" is present

KaiZen:

KaiZen have a ValidationItem to report a severity, a message and a position.

The position is strongly coupled with the source file (JSON), which might be not ideal in our case because the model can be derived from the Annotations or built from scratch using the OASFactory.

But if someone build a parser that uses the Eclipse-MP-OpenAPI model, then having the location in the source file (JSON or YAML) might also be interesting.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
arthurdmcommented, Feb 25, 2019

One of the things we discussed at the hangout today was:

  • Configure OpenAPI validation via mp.openapi.validation
  • Fetch validation results (array of errors or something like Document is valid) by calling openapi/validation

The validation support would be optional for vendors. Thoughts?

0reactions
MikeEdgarcommented, Feb 21, 2022

Closing for now, please reopen if there is still interest in this feature.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to validate OpenAPI definitions - Swagger
How to validate OpenAPI definitions in Swagger Editor using GitHub Actions. ... The OpenAPI Specification (OAS) defines a standard, ...
Read more >
Handling API validation with OpenAPI (Swagger) documents ...
Using the OpenAPI specification, I created an nodejs express app that uses the spec to enforce validation on the endpoints I wrote, ...
Read more >
OpenAPI Codegen - openVALIDATION
The validation integrated in OpenAPI Specification is based on the JSON Schema Validation specification. Each of the specified validation options mainly ...
Read more >
How to validate openapi 3.0.0 yaml spec? - Stack Overflow
I have a yaml specification that has been updated from swagger 2.0 to openapi 3.0. 0. The file itself is about 7,000 lines...
Read more >
Swagger & OpenAPI Online Validator - API Dev Tools
Swagger/OpenAPI online validator · Validate against Swagger/OpenAPI schema · Validate against Swagger/OpenAPI spec.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found