Skip to content

Conversation

@wtrocki
Copy link
Member

@wtrocki wtrocki commented Mar 6, 2025

Proposed changes

CLOUDP-271997

Changes Overview

This first PR implements OpenAPI specification validation for IPA-108 guidelines related to DELETE operations. The implementation adds linting rules that verify DELETE methods follow REST API best practices.

Components Implemented

Rule: xgen-IPA-108-delete-response-should-be-empty

  • Validates that DELETE operations return empty responses (204 No Content)
  • Ensures response objects don't include schema definitions
  • Implemented in deleteMethodResponseShouldNotHaveSchema.js

@wtrocki wtrocki requested a review from a team as a code owner March 6, 2025 10:43
Co-authored-by: Lovisa Berggren <59226031+lovisaberggren@users.noreply.github.com>
wtrocki and others added 2 commits March 6, 2025 17:03
Co-authored-by: Yeliz Henden <165907936+yelizhenden-mdb@users.noreply.github.com>
@wtrocki wtrocki requested a review from yelizhenden-mdb March 6, 2025 16:13
}
}
} catch (e) {
return ['Internal Rule Error without reporting violation' + e];
Copy link
Member Author

@wtrocki wtrocki Mar 7, 2025

Choose a reason for hiding this comment

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

We can get different error when rule missbehaves. That gives us:

  • Ability to understand the issue at runtime and tests instead of getting generic AggregateError: Error running Nimma
  • Protect production failure to break entire validation. Users will be able to add exception until we fix problem in single rule but other rules will still work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to helper for reuse.

delete: {
responses: {
204: {
'application/vnd.atlas.2023-01-01+json': {
Copy link
Collaborator

Choose a reason for hiding this comment

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

❤️

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! Great work with big impact on formalizing the rule implementation

@wtrocki wtrocki merged commit 3b6b3fb into main Mar 7, 2025
13 checks passed
@wtrocki wtrocki deleted the CLOUDP-271997 branch March 7, 2025 17:40
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.

4 participants