Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow: Moving some API Response annotations to the class #30985

Closed
Tracked by #28600
jdcmsd opened this issue Dec 19, 2024 · 1 comment · Fixed by #30986
Closed
Tracked by #28600

Workflow: Moving some API Response annotations to the class #30985

jdcmsd opened this issue Dec 19, 2024 · 1 comment · Fixed by #30986

Comments

@jdcmsd
Copy link
Contributor

jdcmsd commented Dec 19, 2024

Parent Issue

#28600

Task

This is sort of a test run to see how if it's an improvement to inherit some baseline HTTP responses from the class when they're constant across all member methods/operations.

Basic behaviors:

  • @ApiReponse annotation values fed to the class via @ApiResponses are present in all class methods.
  • When a method uses an @ApiResponse annotation with the same code as the class, it overrides for just that method.
  • If a method uses an @ApiResponse code NOT present in the class, it will not affect any of the others; it still inherits from the class, but now has an extra response code.

In other words, it cleans up the code a bit and removes some redundancy to find response codes that are present for all methods and move them to the class in their most common value, then override the less common forms. So, in the case of Workflow, that's 401, 403, and 500.

If there are response codes that are not used by all methods (like 404) it's better to specify them at the method level; I'm not sure if there's a way to override subtractively.

Proposed Objective

Documentation

Proposed Priority

Priority 4 - Trivial

Acceptance Criteria

Move those three response codes into the class.

Copy link

@jdcmsd jdcmsd linked a pull request Dec 19, 2024 that will close this issue
@jdcmsd jdcmsd moved this from New to In Review in dotCMS - Product Planning Dec 19, 2024
@jdcmsd jdcmsd moved this from In Review to New in dotCMS - Product Planning Dec 19, 2024
@jdcmsd jdcmsd moved this from New to In Review in dotCMS - Product Planning Dec 19, 2024
@jdcmsd jdcmsd moved this from In Review to In Progress in dotCMS - Product Planning Dec 19, 2024
@jdcmsd jdcmsd moved this from In Progress to In Review in dotCMS - Product Planning Dec 19, 2024
@github-project-automation github-project-automation bot moved this from In Review to Done in dotCMS - Product Planning Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant