Skip to content

Conversation

erunion
Copy link
Member

@erunion erunion commented Oct 13, 2025

🚥 Resolves CX-2403

🧰 Changes

We currently do not support OpenAPI 3.2 so we should not allow any 3.2 API definitions to be validated as they will fail due to our parser internals attempting to validate them as 3.0.

@erunion erunion added the bug Something isn't working label Oct 13, 2025
@erunion erunion requested a review from kanadgupta October 13, 2025 21:09
* @returns If the definition is a 3.0 definition.
*/
export function isOAS30(check: OpenAPIV3_1.Document | OpenAPIV3.Document): check is OpenAPIV3.Document {
return check.openapi.startsWith('3.0');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this needs a few more typeguards in order to get tests passing:

Suggested change
return check.openapi.startsWith('3.0');
return 'openapi' in check && check.openapi !== undefined && check.openapi.startsWith('3.0');

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should make the same change to isOAS31 because I just copied it across.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants