Skip to content

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

@ShambuGIT

Description

@ShambuGIT

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions