express-openapi-validator and swagger-jsdoc?
See original GitHub issueIs it possible to combine swagger-jsdoc with express-openapi-validator?
The following code:
var schema = swaggerJsdoc( {
swaggerDefinition: {
openapi: '3.0.0',
info: {
title: 'Title',
description: 'API',
version: '1.0.0',
},
servers: [{url: '/'}]
},
apis: ['./src/**/*.js']
})
// OpenApi validation
app.use(OpenApiValidator.middleware({
apiSpec: schema,
validateRequests: true,
validateResponses: false
}))
Gives the error:
error: openapi.validator: args.apiDoc was invalid. See the output.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
express-openapi-validator VS swagger-jsdoc
The express-openapi-validator package addresses this issue by validating requests and responses based on a provided OpenAPI spec. Having our responses validated ...
Read more >Adding request and response validation to your Express ...
The express-openapi-validator package addresses this issue by validating requests and responses based on a provided OpenAPI spec. Having our ...
Read more >express-openapi-validator
Automatically validate API requests and responses with OpenAPI 3 and Express.. Latest version: 5.0.0, last published: a month ago.
Read more >express-openapi-validator does not validates the request ...
When hitting endpoint, express-openapi-validator does not validate ... listen // Serve the OpenAPI spec const swaggerJsDocs = yaml.load('.
Read more >express-jsdoc-swagger
express-jsdoc-swagger. With this library, you can document your express endpoints using swagger OpenAPI 3 Specification without writing YAML or JSON.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like it works now, turns out I had an error in my schema.
This indicates that the schema is invalid:
What I don’t understand is, if validation is done on the schema, why it does not tell me what is wrong with the schema.
This would be great for debugging.
What does the output say?