Skip to content

Conversation

@lovisaberggren
Copy link
Collaborator

@lovisaberggren lovisaberggren commented Mar 11, 2025

Proposed changes

Optional validations failed in OAS release due to bug in rule xgen-IPA-104-get-method-returns-response-suffixed-object. When resolving a schema for non-2xx responses, it's undefined and wasn't checked for before checking if it has a schema.

Also added a test that will catch this if it happens again.

See failures: https://github.com/mongodb/openapi/actions/runs/13786521109

Jira ticket: CLOUDP-305831

@lovisaberggren lovisaberggren marked this pull request as ready for review March 11, 2025 12:07
@lovisaberggren lovisaberggren requested a review from a team as a code owner March 11, 2025 12:07
Copy link
Collaborator

@yelizhenden-mdb yelizhenden-mdb left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment on lines +54 to +56
401: {
$ref: '#/components/schemas/BadRequest',
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Example of what caused the failure, since this rule operates on the unresolved schema, this will end up as undefined, since we're trying to get the schema ref inside of /content/version. Also moved the check for 2xx response first to not evaluate these

@lovisaberggren lovisaberggren merged commit fc05b80 into main Mar 11, 2025
13 checks passed
@lovisaberggren lovisaberggren deleted the CLOUDP-305831 branch March 11, 2025 12:09
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.

2 participants