From 8eb5d6b2c06f2db151485fd0261beb32952526b3 Mon Sep 17 00:00:00 2001 From: JuanfeSanahuja Date: Tue, 14 Jan 2025 14:03:36 +0100 Subject: [PATCH] replaceAll {apiVersion} v2 #TASK-5914 --- .../server/generator/openapi/JsonOpenApiGenerator.java | 4 ++-- .../java/org/opencb/opencga/server/rest/MetaWSServer.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/generator/openapi/JsonOpenApiGenerator.java b/opencga-server/src/main/java/org/opencb/opencga/server/generator/openapi/JsonOpenApiGenerator.java index 74a7a44261..55033aee36 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/generator/openapi/JsonOpenApiGenerator.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/generator/openapi/JsonOpenApiGenerator.java @@ -176,14 +176,14 @@ private List extractParameters(java.lang.reflect.Method method, Strin } // AƱadir encabezado Authorization con el token preconfigurado - Parameter authorizationHeader = new Parameter(); + /* Parameter authorizationHeader = new Parameter(); authorizationHeader.setName("Authorization"); authorizationHeader.setIn("header"); authorizationHeader.setDescription("Bearer token for authorization"); authorizationHeader.setRequired(true); authorizationHeader.setType("string"); authorizationHeader.setDefaultValue("Bearer " + token); - parameters.add(authorizationHeader); + parameters.add(authorizationHeader);*/ return parameters; } diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/MetaWSServer.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/MetaWSServer.java index 9cf68a5ec2..267c64f329 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/MetaWSServer.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/MetaWSServer.java @@ -171,7 +171,7 @@ public String openApi(@ApiParam(value = "List of categories to get API from") @Q String swaggerJson ="ERROR: Swagger could not be generated"; ObjectMapper mapper = new ObjectMapper(); try { - swaggerJson = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(swagger); + swaggerJson = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(swagger).replaceAll("{apiVersion}", "v2"); } catch (JsonProcessingException e) { throw new RuntimeException(e); }