Skip to content

Conversation

@yelizhenden-mdb
Copy link
Collaborator

Proposed changes

Jira ticket: CLOUDP-304941

Create methods must return a 201 Created response code

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works

Changes to Spectral

  • I have read the README file for Spectral Updates

Further comments

@yelizhenden-mdb yelizhenden-mdb marked this pull request as ready for review March 12, 2025 09:28
@yelizhenden-mdb yelizhenden-mdb requested a review from a team as a code owner March 12, 2025 09:28
Comment on lines 18 to 20
if (isCustomMethodIdentifier(resourcePath)) {
return;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: Should be skip non-resource collection paths as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have also been thinking about it lately. Because in IPAs, it is mentioned that make a POST request to a collection's URI. It makes sense to skip non-resource collection paths. I will share another PR refactoring the Create methods with that check

Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool, yeah then I think we can discard some of the paths that are /resource/resource which may be more of custom cases

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I think so

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I made the changes for this rule on this PR. For others: #529

@yelizhenden-mdb yelizhenden-mdb merged commit 5dec957 into main Mar 12, 2025
13 checks passed
@yelizhenden-mdb yelizhenden-mdb deleted the CLOUDP-304941 branch March 12, 2025 11:53
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