Forum Discussion

BATMAN_2008's avatar
New Contributor
3 years ago

Swagger UI does not show the externalValue URL contents while using @ExampleObject under @Content

I am developing a Quarkus REST-based application where I would like to display the API on SwaggerUI. Along with that, I would like to display the example schema file on my SwaggerUI.


For the Schema file, I would like to read the contents from External URL. So I am using the `external value` of the `@ExampleObject` annotation but for some reason, it does not load the file contents from the URL. It just displays:

"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}


Following is the Java Resources file with my `Swagger` annotations:


import org.eclipse.microprofile.openapi.annotations.parameters.Parameter;
import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody;

public class Resources{

@RequestBody(description = "InputTemplate",
content = @Content(examples = {
@ExampleObject(name = "Schema Example", externalValue = "")
public Multi<String> generateTestData(final Map<String, Object> input){
return null;


Following is the screenshot from the SwaggerUI where it's not displaying my JSON file contents:



enter image description here


1. Can someone please explain to me how to add the External JSON file to the example Request Body?

2. Also, is there a way to loop over the list of files present in the external URL path so it can display them one by one in the drop-down? Like if I have a list of files in
a GitHub folder, I can give the Folder URL so it can loop over files in that folder and display the contents and name in the drop-down of the Swagger UI?


I got this link but am unable to understand how to add `Annotations` to my JAVA Class:


No RepliesBe the first to reply