-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Unable to add example value for body #3208
Comments
This works for me in swagger core 2.0.6:
generates the following output in openapi.json:
Then if you use the latest swagger ui (check this out swagger-api/swagger-ui#2651), you'll have it rendered. |
I put the following swagger annotation to a request body method argument, but the
The swagger shows the If I change the |
Version: swagger core 2.0.8, (openapi 3)
I am following the Swagger 2.0 Annotation docs , but I am unable to view example value for body in swagger UI.
public Response updateUserInfo(@RequestBody(description = "", required = true, content = @Content(mediaType = "application/json")}) final String userInfo)
Is there any equivalent of
@ApiImplicitParams
or@ExampleProperty
(from swagger 1.x) for body in swagger 2.x.Though the above doc states an example for
@ApiResponse
:examples = { @ExampleObject(name = "boo", value = "example",summary = "example of boo", externalValue = "example of external value") }
but this is not working for body.
I have also tried this but the example does not show up in swagge UI:
public Response updateUserInfo(@Parameter(examples = {@ExampleObject(name = "userInfo", value = "some example")})) final String userInfo)
The text was updated successfully, but these errors were encountered: