Skip to content

Inconsistent swagger generation on multiple hits #100

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

Closed
patips34 opened this issue Sep 27, 2019 · 1 comment
Closed

Inconsistent swagger generation on multiple hits #100

patips34 opened this issue Sep 27, 2019 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@patips34
Copy link

patips34 commented Sep 27, 2019

On error, I want to return no content from my API. I am trying to achieve like this (Picked up example from the demo), I have added 'content' to 400 as Void.class:

`@Operation(summary = "Find pet by ID", description = "Returns a single pet", security = {
@securityrequirement(name = "api_key") }, tags = { "pet" })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @content(schema = @Schema(implementation = Pet.class))),
@ApiResponse(responseCode = "400", description = "Invalid ID supplied", content = @content(schema = @Schema(implementation = Void.class))),

default ResponseEntity<Pet> getPetById(
		@Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") Long petId) {
	return getDelegate().getPetById(petId);
}

`

In First Hit, it shows: Empty response for 400 response code.
If you hit swagger endpoint again, it will start showing up the Pet body again as response to 400.

@springdoc springdoc added the duplicate This issue or pull request already exists label Sep 28, 2019
@springdoc
Copy link
Collaborator

springdoc commented Sep 28, 2019

This issue is duplicate of #96.
You can have a look at v1.1.44 which fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

1 participant