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

ExampleObject with examples having externalValue does not load in swagger-ui #1432

Closed
ShambuGIT opened this issue Jan 9, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@ShambuGIT
Copy link

Issue
Configuring the @ExampleObject with examples specifying the externalValue="http://localhost:8090/context/examples/test.json" not showing in swagger-ui.

RestController

 @GetMapping("/testopenapi")
   @Operation(summary = "Get thing", responses = {
           @ApiResponse(description = "Successful Operation", responseCode = "200", content = @Content(examples = @ExampleObject(name = "readJson", externalValue = "http://localhost:8090/context/examples/test.json", summary = "Request")))
           })
   public @ResponseBody ResponseEntity<String> testopenapi()
   {
       return new ResponseEntity<String>("Hello welcome! This is testopenapi controller.",
               HttpStatus.OK);
   }

Issue screenshot
image

I tried multiple options specified in forum but noting helped much. But if i change it to value and provide the json as string it works fine.

@bnasslahsen
Copy link
Contributor

@ShambuGIT,

Do not create duplicates.
This is already answered here #17

@springdoc springdoc locked as too heated and limited conversation to collaborators Jan 9, 2022
@bnasslahsen bnasslahsen added the duplicate This issue or pull request already exists label Jan 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants