Skip to content

Conversation

@lovisaberggren
Copy link
Collaborator

@lovisaberggren lovisaberggren commented Mar 27, 2025

Proposed changes

New rule xgen-IPA-117-plaintext-response-must-have-example checks that 2xx responses (non-json and non-yaml) have examples in the object or in the schema.

Also updated the IPA validation that runs on the PRs to use the spectral CLI instead of the action, since the action runs on a downloaded spec it can't show the annotations in the PR as a result. The spectral CLI output is a bit more useful as it shows all warnings/errors and the component that is violating.

Before:

Screenshot 2025-03-27 at 17 45 07

After:

Screenshot 2025-03-27 at 17 44 58

Jira ticket: CLOUDP-306573

@lovisaberggren
Copy link
Collaborator Author

lovisaberggren commented Mar 27, 2025

IPA failure related to xgen-IPA-113-singleton-should-have-update-method which has a fix on MMS side, will be corrected with the next OAS release run

@lovisaberggren lovisaberggren marked this pull request as ready for review March 27, 2025 17:46
@lovisaberggren lovisaberggren requested a review from a team as a code owner March 27, 2025 17:46
with:
file_glob: v2.yaml
spectral_ruleset: tools/spectral/ipa/ipa-spectral.yaml
run: npx spectral lint v2.yaml --ruleset=./tools/spectral/ipa/ipa-spectral.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

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

❤️

message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-plaintext-response-must-have-example'
severity: warn
given:
- '$.paths[*][get,put,post,delete,options,head,patch,trace].responses[*].content'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: I know this comes a long way but.. Do we need to specify them? Do you remember what is the reason behind specifying HTTP methods?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, if we don't specify them this will also target other things like extension properties as well. For this line specifically the risk is pretty low to have an extension with responses and content, but just as a safe-guard

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.

LGTM

@lovisaberggren lovisaberggren merged commit 73684db into main Mar 27, 2025
7 of 8 checks passed
@lovisaberggren lovisaberggren deleted the CLOUDP-306573 branch March 27, 2025 18:17
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.

3 participants