Conversation
In OpenAPI v3.1 the nullable property was replaced with a "typed array", that is an array that can either be of type T or null. To make the minimal amount of changes this commit converts a type array back into what a 3.0 parser would expect. Closes acacode#991
|
|
@smorimoto any chance you could review this? We could really use this change. |
| property.type = property.type[0]; | ||
| property.nullable = true; | ||
| } | ||
| } |
There was a problem hiding this comment.
I had to add also this after your condition, to type array with single type work.
if (Array.isArray(property.type) && property.type.length == 1) { property.type = property.type[0]; }
Example yaml:
SomeType:
type:
- string
enum:
- one
- two
OtherComponent:
type: object
properties:
type:
$ref: '#/components/schemas/SomeType'
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no bugs!
Bugbot free trial expires on September 2, 2025
Learn more in the Cursor dashboard.
|
up! any chance to merge it ? |
|
any possibility to get this merged soon? 😄 |
In OpenAPI v3.1 the nullable property was replaced with a "typed array", that is an array that can either be of type T or null.
To make the minimal amount of changes this commit converts a type array back into what a 3.0 parser would expect.
Closes #991