diff --git a/src/main/java/org/etsi/osl/tmf/configuration/SwaggerDocumentationConfig.java b/src/main/java/org/etsi/osl/tmf/configuration/SwaggerDocumentationConfig.java index 9cd05ca2d7aa90f70fc1791abc93da7e69524818..239be290194fb3da0c4bd4c908d742c492c08ef9 100644 --- a/src/main/java/org/etsi/osl/tmf/configuration/SwaggerDocumentationConfig.java +++ b/src/main/java/org/etsi/osl/tmf/configuration/SwaggerDocumentationConfig.java @@ -740,7 +740,7 @@ public class SwaggerDocumentationConfig { .specVersion( SpecVersion.V30 ).addSecurityItem(new SecurityRequirement().addList("security_auth")) .info(new Info() .title("TMF 674 Geographic Site Management") - .description("## TMF API Reference: TMF674 - Geographic Site Management ### Release : 20.0 - April 2020 ") + .description("## TMF API Reference: TMF674 - Geographic Site Management ") .version("4.0.0") .license(new License() .name("Apache 2.0") @@ -758,7 +758,7 @@ public class SwaggerDocumentationConfig { return GroupedOpenApi.builder() .group("tmf-api-674-Geographic Site Management-v4.0.0") - .addOpenApiCustomizer( this.stm653OpenAPI() ) + .addOpenApiCustomizer( this.gsm674OpenAPI() ) .packagesToScan("org.etsi.osl.tmf.gsm674.api") .build(); diff --git a/src/main/java/org/etsi/osl/tmf/gsm674/api/GeographicSiteManagementApi.java b/src/main/java/org/etsi/osl/tmf/gsm674/api/GeographicSiteManagementApi.java index c50b604d4232cc2395c89cc1163617c792459f15..4dc625839c41937f97438f04edd73c2c8aabc095 100644 --- a/src/main/java/org/etsi/osl/tmf/gsm674/api/GeographicSiteManagementApi.java +++ b/src/main/java/org/etsi/osl/tmf/gsm674/api/GeographicSiteManagementApi.java @@ -56,18 +56,6 @@ public interface GeographicSiteManagementApi { consumes = { "application/json" }, method = RequestMethod.POST) default ResponseEntity<GeographicSite> createGeographicSite(@Parameter(description = "The geographic site to be created" ,required=true ) @Valid @RequestBody GeographicSite geographicSite) { - if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) { - if (getAcceptHeader().get().contains("application/json")) { - try { - return new ResponseEntity<>(getObjectMapper().get().readValue("{ \"@baseType\" : \"@baseType\", \"validFor\" : { \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\", \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\" }, \"@type\" : \"@type\", \"name\" : \"name\", \"description\" : \"description\", \"href\" : \"href\", \"id\" : \"id\", \"@schemaLocation\" : \"@schemaLocation\", \"objective\" : [ { \"@referredType\" : \"@referredType\", \"href\" : \"href\", \"id\" : \"id\" }, { \"@referredType\" : \"@referredType\", \"href\" : \"href\", \"id\" : \"id\" } ]}", GeographicSite.class), HttpStatus.NOT_IMPLEMENTED); - } catch (IOException e) { - log.error("Couldn't serialize response for content type application/json", e); - return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); - } - } - } else { - log.warn("ObjectMapper or HttpServletRequest not configured in default GeographicSiteManagementApi interface so no example is generated"); - } return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -86,10 +74,6 @@ public interface GeographicSiteManagementApi { consumes = { "application/json" }, method = RequestMethod.DELETE) default ResponseEntity<Void> deleteGeographicSite(@Parameter(description = "Identifier of the Geographic site",required=true) @PathVariable("id") String id) { - if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) { - } else { - log.warn("ObjectMapper or HttpServletRequest not configured in default GeographicSiteManagementApi interface so no example is generated"); - } return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -109,19 +93,7 @@ public interface GeographicSiteManagementApi { consumes = { "application/json" }, method = RequestMethod.GET) default ResponseEntity<List<GeographicSite>> listGeographicSite() { - if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) { - if (getAcceptHeader().get().contains("application/json")) { - try { - return new ResponseEntity<>(getObjectMapper().get().readValue("[ { \"@baseType\" : \"@baseType\", \"validFor\" : { \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\", \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\" }, \"@type\" : \"@type\", \"name\" : \"name\", \"description\" : \"description\", \"href\" : \"href\", \"id\" : \"id\", \"@schemaLocation\" : \"@schemaLocation\", \"objective\" : [ { \"@referredType\" : \"@referredType\", \"href\" : \"href\", \"id\" : \"id\" }, { \"@referredType\" : \"@referredType\", \"href\" : \"href\", \"id\" : \"id\" } ]}, { \"@baseType\" : \"@baseType\", \"validFor\" : { \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\", \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\" }, \"@type\" : \"@type\", \"name\" : \"name\", \"description\" : \"description\", \"href\" : \"href\", \"id\" : \"id\", \"@schemaLocation\" : \"@schemaLocation\", \"objective\" : [ { \"@referredType\" : \"@referredType\", \"href\" : \"href\", \"id\" : \"id\" }, { \"@referredType\" : \"@referredType\", \"href\" : \"href\", \"id\" : \"id\" } ]} ]", List.class), HttpStatus.NOT_IMPLEMENTED); - } catch (IOException e) { - log.error("Couldn't serialize response for content type application/json", e); - return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); - } - } - } else { - log.warn("ObjectMapper or HttpServletRequest not configured in default GeographicSiteManagementApi interface so no example is generated"); - } - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -140,18 +112,6 @@ public interface GeographicSiteManagementApi { consumes = { "application/json" }, method = RequestMethod.PATCH) default ResponseEntity<GeographicSite> patchGeographicalSite(@Parameter(description = "Identifier of the Geographic site",required=true) @PathVariable("id") String id,@Parameter(description = "The Service Level Specification to be updated" ,required=true ) @Valid @RequestBody GeographicSite geographicSite) { - if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) { - if (getAcceptHeader().get().contains("application/json")) { - try { - return new ResponseEntity<>(getObjectMapper().get().readValue("{ \"@baseType\" : \"@baseType\", \"validFor\" : { \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\", \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\" }, \"@type\" : \"@type\", \"name\" : \"name\", \"description\" : \"description\", \"href\" : \"href\", \"id\" : \"id\", \"@schemaLocation\" : \"@schemaLocation\", \"objective\" : [ { \"@referredType\" : \"@referredType\", \"href\" : \"href\", \"id\" : \"id\" }, { \"@referredType\" : \"@referredType\", \"href\" : \"href\", \"id\" : \"id\" } ]}", GeographicSite.class), HttpStatus.NOT_IMPLEMENTED); - } catch (IOException e) { - log.error("Couldn't serialize response for content type application/json", e); - return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); - } - } - } else { - log.warn("ObjectMapper or HttpServletRequest not configured in default GeographicSiteManagementApi interface so no example is generated"); - } return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -171,18 +131,6 @@ public interface GeographicSiteManagementApi { consumes = { "application/json" }, method = RequestMethod.GET) default ResponseEntity<GeographicSite> retrieveGeographicSite(@Parameter(description = "Identifier of the Geographic site",required=true) @PathVariable("id") String id) { - if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) { - if (getAcceptHeader().get().contains("application/json")) { - try { - return new ResponseEntity<>(getObjectMapper().get().readValue("[ { \"@baseType\" : \"@baseType\", \"validFor\" : { \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\", \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\" }, \"@type\" : \"@type\", \"name\" : \"name\", \"description\" : \"description\", \"href\" : \"href\", \"id\" : \"id\", \"@schemaLocation\" : \"@schemaLocation\", \"objective\" : [ { \"@referredType\" : \"@referredType\", \"href\" : \"href\", \"id\" : \"id\" }, { \"@referredType\" : \"@referredType\", \"href\" : \"href\", \"id\" : \"id\" } ]}, { \"@baseType\" : \"@baseType\", \"validFor\" : { \"startDateTime\" : \"2000-01-23T04:56:07.000+00:00\", \"endDateTime\" : \"2000-01-23T04:56:07.000+00:00\" }, \"@type\" : \"@type\", \"name\" : \"name\", \"description\" : \"description\", \"href\" : \"href\", \"id\" : \"id\", \"@schemaLocation\" : \"@schemaLocation\", \"objective\" : [ { \"@referredType\" : \"@referredType\", \"href\" : \"href\", \"id\" : \"id\" }, { \"@referredType\" : \"@referredType\", \"href\" : \"href\", \"id\" : \"id\" } ]} ]", GeographicSite.class), HttpStatus.NOT_IMPLEMENTED); - } catch (IOException e) { - log.error("Couldn't serialize response for content type application/json", e); - return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); - } - } - } else { - log.warn("ObjectMapper or HttpServletRequest not configured in default GeographicSiteManagementApi interface so no example is generated"); - } return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); }