Skip to content

Conversation

@lovisaberggren
Copy link
Collaborator

@lovisaberggren lovisaberggren commented Mar 21, 2025

Proposed changes

Adds rule to check for descriptions presence and empty descriptions, it covers:

  • Info object
  • Tags
  • Operation objects
  • Inline schema properties for operation object requests and responses
  • Parameter objects (in operations and components)
  • Schema properties

It can replace the legacy spectral check we have right now.

The violations are the same as we have for the legacy rule:

xgen-IPA-117-description  Description not found. API producers must provide descriptions for Properties, Operations and Parameters. https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-description  components.schemas.ClusterProviderSettings.properties.providerName
xgen-IPA-117-description  Description not found. API producers must provide descriptions for Properties, Operations and Parameters. https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-description  components.schemas.DataLakeStoreSettings.properties.provider
xgen-IPA-117-description  Description not found. API producers must provide descriptions for Properties, Operations and Parameters. https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-description  components.schemas.charFiltermapping.properties.mappings.properties.additionalProperties

Jira ticket: CLOUDP-304965

Comment on lines +23 to +29
- '$.info'
- '$.tags[*]'
- '$.paths[*][get,put,post,delete,options,head,patch,trace]'
- '$.paths[*][get,put,post,delete,options,head,patch,trace].parameters[*]'
- '$.paths[*][get,put,post,delete,options,head,patch,trace]..content..properties[*]'
- '$.components.schemas..properties[*]'
- '$.components.parameters[*]'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI wanted to use aliases for these, but got an anonymous error from Spectral, not sure why, perhaps aliases don't work with custom functions. I went like this for now and will see if I can get aliases working, or if I need to open an issue with Spectral

@lovisaberggren lovisaberggren marked this pull request as ready for review March 21, 2025 13:48
@lovisaberggren lovisaberggren requested a review from a team as a code owner March 21, 2025 13:48
@yelizhenden-mdb
Copy link
Collaborator

Q: Don't we need to run IPA docs generation?

@lovisaberggren
Copy link
Collaborator Author

Q: Don't we need to run IPA docs generation?

Hmm yes I'll check why it didn't fail

@lovisaberggren
Copy link
Collaborator Author

@yelizhenden-mdb I didn't add the new ruleset to the base ipa-spectral file so it wasn't included in the validation or the docs

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, thanks!

@lovisaberggren lovisaberggren merged commit 3915e0a into main Mar 21, 2025
8 checks passed
@lovisaberggren lovisaberggren deleted the CLOUDP-304965 branch March 21, 2025 16:35
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