Skip to content

Commit

Permalink
Produces application/json #TASK-5914
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfeSanahuja committed Jan 15, 2025
1 parent 56dd00f commit ee1a577
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ public Swagger generateJsonOpenApi(ApiCommons apiCommons, String token, String e
swagger.setInfo(info);
swagger.setHost("test.app.zettagenomics.com");
swagger.setBasePath(environment + "/opencga/webservices/rest");

List<String> schemes = new ArrayList<>();
schemes.add("https");
swagger.setSchemes(schemes);

Map<String, Map<String, Method>> paths = new HashMap<>();
List<Tag> tags = new ArrayList<>();

Expand Down Expand Up @@ -66,22 +64,18 @@ public Swagger generateJsonOpenApi(ApiCommons apiCommons, String token, String e
if(apiOperation.response() instanceof Class){
beansDefinitions.add((Class) apiOperation.response());
}

method.getResponses().put("200", responses);

// Obtener el método HTTP
String httpMethod = extractHttpMethod(wsmethod);
if (httpMethod == null) continue;


Consumes consumes = wsmethod.getAnnotation(Consumes.class);
// Extraer parámetros
List<Parameter> parameters = extractParameters(wsmethod, token);
method.setParameters(parameters);
if (consumes != null){
method.getConsumes().addAll(Arrays.asList(consumes.value()));
}
method.getProduces().add(String.valueOf(apiOperation.response()));
method.getProduces().add("application/json");
// Ruta completa del endpoint
javax.ws.rs.Path methodPathAnnotation = wsmethod.getAnnotation(javax.ws.rs.Path.class);
String fullPath = basePath + (methodPathAnnotation != null ? methodPathAnnotation.value() : "");
Expand Down

0 comments on commit ee1a577

Please sign in to comment.