Skip to content

Conversation

@wuerges
Copy link

@wuerges wuerges commented Feb 13, 2025

The pull request goal is to fix an edge case of the down conversion where orphan oneOf([{ "type": "null" }, {..}] would be converted to oneOf([{ "nullable": true }, {..}].

This is invalid because nullable must have a sibling type field.
This PR adds the type.

If the type is array. It also inlines the array type, because type: array are required to have a sibling items object.

Please refer to the tests cases added to understand the change with detail.

The conversion result was tested with spotlight spectral, and the results look good on other files of a much larger project.

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

Successfully merging this pull request may close these issues.

1 participant