Questions tagged [express-openapi-validator]

10 questions
4
votes
1 answer

express-openapi-validator: ERROR: TypeError: Cannot read property 'schema' of undefined

I have a openapi schema definition like this: openapi: 3.0.0 info: title: Manual Handling description: API documentation for manual handling. version: 0.1.9 servers: - url: / description: Self - url:…
NIKHIL C M
  • 3,873
  • 2
  • 28
  • 35
3
votes
3 answers

How to add custom middleware to express-openapi-validator using Swagger 3

I've got a Node app using express-openapi-validator that takes a an api spec file (which is a .yml file), with request and response validation. The express-openapi-validator package routes the request to a handler file (defined in the spec). This is…
nkhil
  • 1,452
  • 1
  • 18
  • 37
1
vote
1 answer

openapi-validator sends html instead of json in response

I am using an operation handler for requests. In the oas scheme I defined create user as: /users: post: description: | creates a user operationId: createUser x-eov-operation-handler: controllers/user.controller tags: - Users …
1
vote
1 answer

NestJs/Swagger: How to add `additionalProperties: false` on an existing DTO class

Hello I am new to Nestjs and trying to implement additionalProperties: false on a DTO class that already has properties on it. I see that the additionalProperties key can be added inside @ApiProperty({ schema: ... { additionalProperties : false} })…
ttemple
  • 1,825
  • 2
  • 17
  • 12
1
vote
0 answers

express-openapi-validator does not validates the request against yaml file

When hitting endpoint, express-openapi-validator does not validate the request. api.yaml openapi: 3.0.0 info: title: API Docs description: Authentication version: 1.0.0 servers: - url: http://localhost:3030/oauth description: Local…
ronak patel
  • 378
  • 1
  • 8
  • 24
1
vote
1 answer

Cannot pass dynamic query parameters when using `express-openapi-validator`

The idea is taken from here stack-overflow After adding a parameter that is supposed do allow dynamic query parameters, it gives error. Query Example: /pets: get: description: | Returns all pets operationId: findPets …
Sabbiu Shah
  • 1,569
  • 3
  • 16
  • 28
0
votes
0 answers

"Unsupported OpenAPI / Swagger version=undefined". not able to use express-openapi-validate with node Every time getting this error

i want to validate my api request with express-openapi-validator, but every time i got this error "Unsupported OpenAPI / Swagger version=undefined". Don't know why this comming, just for me, i have tried other guys code from github getting same with…
0
votes
0 answers

how to chain consumesMiddleware on express

environment "express": "^4.16.4" "express-openapi": "^12.0.1" "typescript": "4.6.4" my problem I want to chain consumesMiddleware at express-openapi. On server.ts const dumpBody = (req: Request, _res: Response, next: any) => { …
vikke
  • 341
  • 1
  • 3
  • 8
0
votes
1 answer

Priority of paths in Open API 3

I'm using an openapi validator (express-openapi-validator) in my Node.js project and can't figure out how to control the order of the paths matched. If I have 2 paths such as, /foo/{type} parameters: - name: type schema: …
Mayur
  • 730
  • 8
  • 18
-1
votes
1 answer

How to validate request model received with schema defined in openapi3(swagger) specification -NodeJS

Im looking to find a tool/framework which will allow me to validate/check the model of a received request(s) with a schema thats defined in the swagger documentation.