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

Forbid mutliple @ApiResponse annotations with the same response code #4839

Open
jochenberger opened this issue Jan 30, 2025 · 1 comment
Open

Comments

@jochenberger
Copy link

The response code it the key in a map, e.g.

{
	"responses": {
		"200": {
			"description": "Person loaded",
			"content": ...
		},
		"404": {
			"description": "Person not found",
			"content": ...
		}
	}
}

See also https://swagger.io/docs/specification/v3_0/describing-responses/

So, if a method is annotated with multiple @ApiResponse annotations that define the same responseCode, it is not clear what should happen. It would be nice if that was prevented by the library.

@jochenberger
Copy link
Author

See also #3379

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

No branches or pull requests

1 participant