APIDevTools / swagger-parser

Swagger 2.0 and OpenAPI 3.0 parser/validator
https://apitools.dev/swagger-parser
MIT License
1.1k stars 155 forks source link

BUG: The `validate` field is missing in type definition of options #119

Closed raiyankamal closed 5 years ago

raiyankamal commented 5 years ago

The validate field is accepted in options: https://github.com/APIDevTools/swagger-parser/blob/master/lib/index.js#L123

But this is not included in the type definition for Options: https://github.com/APIDevTools/swagger-parser/blob/master/lib/index.d.ts#L215

As a result, typescript cannot transpile when the validate field exists.

  const api = await  SwaggerParser.validate(swaggerApiSource, {
    validate: {
      spec: true
    }
  });

error TS2345: Argument of type '{ validate: { spec: boolean; }; }' is not assignable to parameter of type 'Options'.```