From 09d3bd146edfcb7124eb96cabf99cbaf4857e5c4 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 17 Nov 2022 13:58:24 -0800 Subject: Add OpenAPI Swagger 3 spec and API generation This commit adds the Policy/API OpenAPI (Swagger) document as a source document under source control. This OpenAPI document was generated from the existing SpringFox annotations in the source code, was uploaded to the online Swagger editor and was converted into OpenAPI 3.0 format. It was then manually edited to correct the return types and to match the input and putput types to our Java classes. The pom.xml is also amended to generate the API interface source doe in the target/generated-sources directory. The generated code does NOT replace the existing API code as yet. Issue-ID: POLICY-4431 Change-Id: Iee1cc6a122deffcd05728e8f34172f8d423ebcef Signed-off-by: liamfallon --- main/pom.xml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'main/pom.xml') diff --git a/main/pom.xml b/main/pom.xml index 9aaea334..d018e691 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -148,6 +148,50 @@ + + io.swagger.codegen.v3 + swagger-codegen-maven-plugin + 3.0.27 + + + code-gen + + generate + + + ${project.basedir}/src/main/resources/openapi/openapi.yaml + org.onap.policy.pap.main.rest + org.onap.policy.models.tosca.authorative.concepts + org.onap.policy.pap.main.rest + spring + false + false + + HealthCheckReport=org.onap.policy.common.endpoints.report.HealthCheckReport, + StatisticsReport=org.onap.policy.pap.main.rest.StatisticsReport, + PdpStatistics=org.onap.policy.models.pdp.concepts.PdpStatistics, + Pdps=org.onap.policy.models.pdp.concepts.Pdps, + PdpState=org.onap.policy.models.pdp.enums.PdpState, + PdpGroupUpdateResponse=org.onap.policy.models.pap.concepts.PdpGroupUpdateResponse, + PdpGroupStateChangeResponse=org.onap.policy.models.pap.concepts.PdpGroupStateChangeResponse, + PdpGroupDeleteResponse=org.onap.policy.models.pap.concepts.PdpGroupDeleteResponse, + PdpGroupDeployResponse=org.onap.policy.models.pap.concepts.PdpGroupDeployResponse, + DeploymentGroups=org.onap.policy.models.pdp.concepts.DeploymentGroups, + PdpDeployPolicies=org.onap.policy.models.pap.concepts.PdpDeployPolicies, + PdpGroups=org.onap.policy.models.pdp.concepts.PdpGroups, + PolicyAudit=org.onap.policy.models.pap.concepts.PolicyAudit, + PolicyStatus=org.onap.policy.models.pap.concepts.PolicyStatus + + + src/gen/java + java11 + true + true + + + + + org.springframework.boot spring-boot-maven-plugin -- cgit 1.2.3-korg