Commit 159a4192 authored by Eduardo Santos's avatar Eduardo Santos
Browse files

Merge branch 'develop' of...

Merge branch 'develop' of https://labs.etsi.org/rep/osl/code/org.etsi.osl.tmf.api into feature/tmf702-api
parents e6d286ce 98ba9b85
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
<factorypath>
    <factorypathentry kind="PLUGIN" id="org.eclipse.jst.ws.annotations.core" enabled="true" runInBatchMode="false"/>
    <factorypathentry kind="EXTJAR" id="C:\Users\ctranoris\.m2\repository\org\mapstruct\mapstruct-processor\1.5.3.Final\mapstruct-processor-1.5.3.Final.jar" enabled="true" runInBatchMode="false"/>
    <factorypathentry kind="VARJAR" id="M2_REPO/org/mapstruct/mapstruct-processor/1.5.3.Final/mapstruct-processor-1.5.3.Final.jar" enabled="true" runInBatchMode="false"/>
    <factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.28/lombok-1.18.28.jar" enabled="true" runInBatchMode="false"/>
</factorypath>
+55 −23
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	             
@@ -109,7 +109,7 @@ public class SwaggerDocumentationConfig {
	            		  .description("## TMF API Reference: TMF620 - Product Catalog Management  ### Release : 19.0 - June 2019  Product Catalog API is one of Catalog Management API Family. Product Catalog API goal is to provide a catalog of products.   ### Operations Product Catalog API performs the following operations on the resources : - Retrieve an entity or a collection of entities depending on filter criteria - Partial update of an entity (including updating rules) - Create an entity (including default values and creation rules) - Delete an entity - Manage notification of events")
	                      
		              .version("4.0.0")
		              .license(new License().name("Apache 2.0").url("http://openslice.io")))
		              .license(new License().name("Apache 2.0").url("https://osl.etsi.org")))
					.externalDocs(new ExternalDocumentation()
							.description("TMF API Tables")
							.url("https://www.tmforum.org/oda/open-apis/table"));	     
@@ -148,7 +148,7 @@ public class SwaggerDocumentationConfig {
						.version("1.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -183,7 +183,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -217,7 +217,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -255,7 +255,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -291,7 +291,7 @@ public class SwaggerDocumentationConfig {
						.version("2.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -328,7 +328,7 @@ public class SwaggerDocumentationConfig {
						.version("2.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -366,7 +366,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -403,7 +403,7 @@ public class SwaggerDocumentationConfig {
						.version("2.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -442,7 +442,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -479,7 +479,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -516,7 +516,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -555,7 +555,7 @@ public class SwaggerDocumentationConfig {
//			            .version("3.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -594,7 +594,7 @@ public class SwaggerDocumentationConfig {
			            .version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -633,7 +633,7 @@ public class SwaggerDocumentationConfig {
			            .version("1.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -671,7 +671,7 @@ public class SwaggerDocumentationConfig {
			            .version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -709,7 +709,7 @@ public class SwaggerDocumentationConfig {
			            .version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -744,7 +744,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));
@@ -781,10 +781,10 @@ public class SwaggerDocumentationConfig {
			            .version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("Openslice")
						.url("http://openslice.io"));	  	                  
						.url("https://osl.etsi.org"));	  	                  
	  }
	
	@Bean
@@ -826,10 +826,10 @@ public class SwaggerDocumentationConfig {
			            .version("1.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("Openslice")
						.url("http://openslice.io"));	  	                  
						.url("https://osl.etsi.org"));	  	                  
	  }
	
	@Bean
@@ -846,6 +846,38 @@ public class SwaggerDocumentationConfig {
	
	}

	/**
	 * TMF 628 Performance Management
	 * @return
	 */
	@Bean
	public OpenApiCustomizer pm628OpenAPI() {
		return openApi -> openApi
				.specVersion( SpecVersion.V30 ).addSecurityItem(new SecurityRequirement().addList("security_auth")) 
				.info(new Info().title("TMF628 Performance Management API")
						.description("TMF628 Performance Management API")
						.version("5.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	             
	  }
	
    @Bean
    public GroupedOpenApi pm628(){

	  	SpringDocUtils.getConfig().replaceWithClass(java.time.LocalDate.class, java.sql.Date.class);
	  	SpringDocUtils.getConfig().replaceWithClass(java.time.OffsetDateTime.class, java.util.Date.class);
        return GroupedOpenApi.builder()
        		.group("tmf-api-628-PerformanceManagement-v5.0.0")
        		.addOpenApiCustomizer( this.pm628OpenAPI() )
        		.packagesToScan("org.etsi.osl.tmf.pm628.api")
        		.build();

    }
	
	
//	@Bean
//    public SecurityConfiguration security() {
+21 −0
Original line number Diff line number Diff line
# OpenAPI generated server

Spring Boot Server

## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.


The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
The specification is available to download using the following url:
http://localhost:8080/v3/api-docs/

Start your server as a simple java application

You can view the api documentation in swagger-ui by pointing to
http://localhost:8080/swagger-ui.html

Change default port value in application.properties
 No newline at end of file
+19 −0
Original line number Diff line number Diff line
package org.etsi.osl.tmf.pm628.api;

import org.springframework.web.context.request.NativeWebRequest;

import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ApiUtil {
    public static void setExampleResponse(NativeWebRequest req, String contentType, String example) {
        try {
            HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class);
            res.setCharacterEncoding("UTF-8");
            res.addHeader("Content-Type", contentType);
            res.getWriter().print(example);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
+273 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading