kogosoftwarellc / open-api

A Monorepo of various packages to power OpenAPI in node
MIT License
895 stars 237 forks source link

[openapi-types] V3.1 Schema Type Wrongly Referenced V3.0 Schema #900

Open moontai0724 opened 8 months ago

moontai0724 commented 8 months ago

In version 3.1 of OpenAPI, the exclusiveMaximum and exclusiveMinimum properties are of type number, whereas they were of type boolean in version 3.0.

When utilizing OpenAPIV3_1, the ParameterObject is referenced as OpenAPIV3.ParameterObject. This leads to a compatibility issue when using number type parameters, resulting in a type error:

Type '{ ... schema: TNumber; }' is not assignable to type 'ParameterObject'.
      Types of property 'schema' are incompatible.
          ...
                Type 'number' is not assignable to type 'boolean | undefined'.
florianmartens commented 4 months ago

I just stumbled on this as well. I was wondering if there was a deeper meaning to this. But I guess it's just a bug.