Skip to content
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

Using x-express-openapi-disable-validation-middleware extension #898

Open
codan84 opened this issue Feb 26, 2024 · 0 comments
Open

Using x-express-openapi-disable-validation-middleware extension #898

codan84 opened this issue Feb 26, 2024 · 0 comments

Comments

@codan84
Copy link

codan84 commented Feb 26, 2024

In your docs and sample project a x-express-openapi-disable-validation-middleware can be added at a top-level api-doc.

However! Configuring top-level api-doc like so in TypeScript results in an error:

Object literal may only specify known properties, and ''x-express-openapi-disable-validation-middleware'' does not exist in type 'Document<{}>'.ts(2353)
(property) 'x-express-openapi-disable-validation-middleware': boolean

Code to reproduce - just use schema with the mentioned vendor extension:

import { OpenAPIV3 } from 'openapi-types'

export const schema: OpenAPIV3.Document = {
  openapi: '3.1.0',
  info: {
    title: 'My API',
    version: '1.0.0',
    description:
      'whatever service'
  },
  paths: {},
  'x-express-openapi-disable-validation-middleware': true
}

The initialize function accepts OpenAPIV3.Document, but this in turn has some props described here missing:
https://github.com/kogosoftwarellc/open-api/blob/main/packages/openapi-types/index.ts#L271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant