From d98b122bd05923942f6ee5b594381c379ca503c8 Mon Sep 17 00:00:00 2001 From: chtrembl <62187826+chtrembl@users.noreply.github.com> Date: Tue, 28 Dec 2021 15:09:46 -0500 Subject: [PATCH] cleanup --- ...s.yml => aks-petstoreservices-ingress.yml} | 0 ...-petstoreservice-ci-cd-to-aks-pipeline.yml | 123 ------- manifests/deployment.yml | 19 - ...eservice-deployment-everything-enabled.yml | 51 --- manifests/petstoreservice-deployment.yml | 31 -- ...toreservice-service-everything-enabled.yml | 11 - manifests/petstoreservice-service.yml | 11 - manifests/service.yml | 10 - .../controller/WebAppController.java | 2 +- .../main/resources/templates/exception.html | 16 + petstore/petstoreservice/.factorypath | 61 --- petstore/petstoreservice/.gitignore | 27 -- petstore/petstoreservice/Dockerfile | 16 - petstore/petstoreservice/README.md | 17 - petstore/petstoreservice/deployment.yml | 40 -- petstore/petstoreservice/pom.xml | 157 -------- .../org/openapitools/OpenAPI2SpringBoot.java | 55 --- .../org/openapitools/RFC3339DateFormat.java | 22 -- .../java/org/openapitools/api/ApiUtil.java | 19 - .../java/org/openapitools/api/PetApi.java | 284 -------------- .../openapitools/api/PetApiController.java | 68 ---- .../java/org/openapitools/api/StoreApi.java | 152 -------- .../openapitools/api/StoreApiController.java | 25 -- .../java/org/openapitools/api/UserApi.java | 210 ----------- .../openapitools/api/UserApiController.java | 25 -- .../configuration/HomeController.java | 19 - .../configuration/MVCConfigurer.java | 22 -- .../OpenAPIDocumentationConfig.java | 71 ---- .../java/org/openapitools/model/Category.java | 105 ------ .../model/ContainerEnvironment.java | 94 ----- .../org/openapitools/model/DataPreload.java | 23 -- .../openapitools/model/ModelApiResponse.java | 130 ------- .../java/org/openapitools/model/Order.java | 246 ------------- .../main/java/org/openapitools/model/Pet.java | 255 ------------- .../main/java/org/openapitools/model/Tag.java | 105 ------ .../java/org/openapitools/model/User.java | 255 ------------- .../java/org/openapitools/model/Version.java | 25 -- .../src/main/resources/application.yml | 344 ----------------- .../application_with_everything_enabled.yml | 347 ------------------ .../src/main/resources/logback-spring.xml | 25 -- .../src/main/resources/version.json | 1 - .../api/TestingWebApplicationTests.java | 30 -- .../src/test/resources/application.yml | 26 -- 43 files changed, 17 insertions(+), 3558 deletions(-) rename manifests/{aks-petstoreservice-ingress.yml => aks-petstoreservices-ingress.yml} (100%) delete mode 100644 manifests/azure-petstoreservice-ci-cd-to-aks-pipeline.yml delete mode 100644 manifests/deployment.yml delete mode 100644 manifests/petstoreservice-deployment-everything-enabled.yml delete mode 100644 manifests/petstoreservice-deployment.yml delete mode 100644 manifests/petstoreservice-service-everything-enabled.yml delete mode 100644 manifests/petstoreservice-service.yml delete mode 100644 manifests/service.yml create mode 100644 petstore/petstoreapp/src/main/resources/templates/exception.html delete mode 100644 petstore/petstoreservice/.factorypath delete mode 100644 petstore/petstoreservice/.gitignore delete mode 100644 petstore/petstoreservice/Dockerfile delete mode 100644 petstore/petstoreservice/README.md delete mode 100644 petstore/petstoreservice/deployment.yml delete mode 100644 petstore/petstoreservice/pom.xml delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/OpenAPI2SpringBoot.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/RFC3339DateFormat.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/api/ApiUtil.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/api/PetApi.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/api/PetApiController.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/api/StoreApi.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/api/StoreApiController.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/api/UserApi.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/api/UserApiController.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/configuration/HomeController.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/configuration/MVCConfigurer.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/model/Category.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/model/ContainerEnvironment.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/model/DataPreload.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/model/ModelApiResponse.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/model/Order.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/model/Pet.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/model/Tag.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/model/User.java delete mode 100644 petstore/petstoreservice/src/main/java/org/openapitools/model/Version.java delete mode 100644 petstore/petstoreservice/src/main/resources/application.yml delete mode 100644 petstore/petstoreservice/src/main/resources/application_with_everything_enabled.yml delete mode 100644 petstore/petstoreservice/src/main/resources/logback-spring.xml delete mode 100644 petstore/petstoreservice/src/main/resources/version.json delete mode 100644 petstore/petstoreservice/src/test/java/org/openapitools/api/TestingWebApplicationTests.java delete mode 100644 petstore/petstoreservice/src/test/resources/application.yml diff --git a/manifests/aks-petstoreservice-ingress.yml b/manifests/aks-petstoreservices-ingress.yml similarity index 100% rename from manifests/aks-petstoreservice-ingress.yml rename to manifests/aks-petstoreservices-ingress.yml diff --git a/manifests/azure-petstoreservice-ci-cd-to-aks-pipeline.yml b/manifests/azure-petstoreservice-ci-cd-to-aks-pipeline.yml deleted file mode 100644 index f22d75ed..00000000 --- a/manifests/azure-petstoreservice-ci-cd-to-aks-pipeline.yml +++ /dev/null @@ -1,123 +0,0 @@ -# Deploy to Azure Kubernetes Service -# Build and push image to Azure Container Registry; Deploy to Azure Kubernetes Service -# https://docs.microsoft.com/azure/devops/pipelines/languages/docker - -trigger: - branches: - include: - - main - paths: - include: - - petstore/petstoreservice/* - -resources: -- repo: self - -variables: - - # Container registry service connection established during pipeline creation - dockerRegistryServiceConnection: '1ff734d3-5c1f-4a69-9c30-a23d515fd3e1' - imageRepository: 'petstoreservice' - containerRegistry: 'azurepetstorecr.azurecr.io' - dockerfilePath: 'petstore/petstoreservice/Dockerfile' - tag: '$(Build.BuildId)' - imagePullSecret: '$(crImagePullSecret)' - -stages: -- stage: Build - displayName: Build stage - jobs: - - job: Analysis - displayName: Security Analysis - pool: - vmImage: 'windows-latest' - steps: - - task: CredScan@2 - inputs: - toolMajorVersion: 'V2' - - - job: Build - displayName: Build App - pool: - vmImage: 'ubuntu-latest' - steps: - - script: echo -n -e "{\"version\":\"$(Build.BuildNumber) - $(tag)\"}" > petstore/petstoreservice/src/main/resources/version.json - - - task: Maven@3 - continueOnError: true - displayName: Build Spring Boot Jar - inputs: - mavenPomFile: 'petstore/petstoreservice/pom.xml' - mavenOptions: '-Xmx3072m' - javaHomeOption: 'JDKVersion' - jdkVersionOption: '8' - jdkArchitectureOption: 'x64' - publishJUnitResults: true - testResultsFiles: 'petstore/petstoreservice/target/surefire-reports/TEST-*.xml' - codeCoverageToolOption: 'jaCoCo' - goals: 'package' - - task: Docker@2 - displayName: Build and push an image to container registry - inputs: - command: buildAndPush - repository: $(imageRepository) - dockerfile: $(dockerfilePath) - containerRegistry: $(dockerRegistryServiceConnection) - tags: | - $(tag) - latest - - - upload: manifests - artifact: manifests - -- stage: Deploy - displayName: Deploy Stage - dependsOn: Build - - jobs: - - deployment: Deploy - displayName: Deploy App - pool: - vmImage: 'ubuntu-latest' - environment: 'Development' - strategy: - runOnce: - deploy: - steps: - - task: KubernetesManifest@0 - displayName: Create secret - inputs: - action: createSecret - kubernetesServiceConnection: azurepetstore-akscluster-default - namespace: default - secretType: dockerRegistry - secretName: $(imagePullSecret) - dockerRegistryEndpoint: $(dockerRegistryServiceConnection) - - task: KubernetesManifest@0 - displayName: Deploy to Kubernetes cluster - inputs: - action: deploy - kubernetesServiceConnection: azurepetstore-akscluster-default - manifests: | - $(Pipeline.Workspace)/manifests/petstoreservice-deployment-everything-enabled.yml - $(Pipeline.Workspace)/manifests/petstoreservice-service-everything-enabled.yml - imagePullSecrets: | - $(imagePullSecret) - containers: | - $(containerRegistry)/$(imageRepository):$(tag) - -- stage: Automation - displayName: Automation stage - jobs: - - job: Automation - displayName: Automation Testing - pool: - vmImage: 'windows-latest' - steps: - - task: TriggerPipeline@1 - inputs: - serviceConnection: 'Automation' - project: '6b3206dd-90b3-40f6-a611-e5a1e5a13593' - Pipeline: 'Build' - buildDefinition: 'azure-petstoreautomation-regression-tests' - Branch: 'main' diff --git a/manifests/deployment.yml b/manifests/deployment.yml deleted file mode 100644 index 59202c85..00000000 --- a/manifests/deployment.yml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion : apps/v1 -kind: Deployment -metadata: - name: petstorepetservices -spec: - replicas: 1 - selector: - matchLabels: - app: petstorepetservices - template: - metadata: - labels: - app: petstorepetservices - spec: - containers: - - name: petstorepetservices - image: azurepetstorecr.azurecr.io/petstorepetservices - ports: - - containerPort: 80 \ No newline at end of file diff --git a/manifests/petstoreservice-deployment-everything-enabled.yml b/manifests/petstoreservice-deployment-everything-enabled.yml deleted file mode 100644 index c77af79e..00000000 --- a/manifests/petstoreservice-deployment-everything-enabled.yml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: petstoreservice -spec: - replicas: 3 - selector: - matchLabels: - app: petstoreservice - template: - metadata: - labels: - app: petstoreservice - spec: - nodeSelector: - "beta.kubernetes.io/os": linux - containers: - - name: petstoreservice - image: azurepetstorecr.azurecr.io/petstoreservice - resources: - requests: - cpu: 250m - memory: 1Gi - limits: - cpu: 500m - memory: 2Gi - ports: - - containerPort: 8080 - env: - - name: PETSTORESERVICE_SERVER_PORT - value: "8080" - - name: spring.config.name - value: application_with_everything_enabled - - name: PETSTORESERVICE_AI_INSTRUMENTATION_KEY - valueFrom: - secretKeyRef: - name: aisecretkey - key: secret ---- -apiVersion: autoscaling/v1 -kind: HorizontalPodAutoscaler -metadata: - name: petstoreservice-hpa -spec: - maxReplicas: 12 # define max replica count - minReplicas: 3 # define min replica count - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: petstoreservice - targetCPUUtilizationPercentage: 80 # target CPU utilization diff --git a/manifests/petstoreservice-deployment.yml b/manifests/petstoreservice-deployment.yml deleted file mode 100644 index 9bfa442a..00000000 --- a/manifests/petstoreservice-deployment.yml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: petstoreservice -spec: - replicas: 1 - selector: - matchLabels: - app: petstoreservice - template: - metadata: - labels: - app: petstoreservice - spec: - nodeSelector: - "beta.kubernetes.io/os": linux - containers: - - name: petstoreservice - image: azurepetstorecr.azurecr.io/petstoreservice - resources: - requests: - cpu: 100m - memory: 128Mi - limits: - cpu: 250m - memory: 256Mi - ports: - - containerPort: 8080 - env: - - name: PETSTORESERVICE_SERVER_PORT - value: "8080" \ No newline at end of file diff --git a/manifests/petstoreservice-service-everything-enabled.yml b/manifests/petstoreservice-service-everything-enabled.yml deleted file mode 100644 index 61cf7455..00000000 --- a/manifests/petstoreservice-service-everything-enabled.yml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: petstoreservice -spec: - type: LoadBalancer - ports: - - port: 80 - targetPort: 8080 - selector: - app: petstoreservice \ No newline at end of file diff --git a/manifests/petstoreservice-service.yml b/manifests/petstoreservice-service.yml deleted file mode 100644 index 61cf7455..00000000 --- a/manifests/petstoreservice-service.yml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: petstoreservice -spec: - type: LoadBalancer - ports: - - port: 80 - targetPort: 8080 - selector: - app: petstoreservice \ No newline at end of file diff --git a/manifests/service.yml b/manifests/service.yml deleted file mode 100644 index 05bd0188..00000000 --- a/manifests/service.yml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: petstorepetservices -spec: - type: LoadBalancer - ports: - - port: 80 - selector: - app: petstorepetservices \ No newline at end of file diff --git a/petstore/petstoreapp/src/main/java/com/chtrembl/petstoreapp/controller/WebAppController.java b/petstore/petstoreapp/src/main/java/com/chtrembl/petstoreapp/controller/WebAppController.java index fc968a92..617ae999 100644 --- a/petstore/petstoreapp/src/main/java/com/chtrembl/petstoreapp/controller/WebAppController.java +++ b/petstore/petstoreapp/src/main/java/com/chtrembl/petstoreapp/controller/WebAppController.java @@ -226,7 +226,7 @@ public String exception(Model model, OAuth2AuthenticationToken token, HttpServle this.sessionUser.getTelemetryClient().trackException(npe); - return "home"; + return "exception"; } @GetMapping(value = "/*") diff --git a/petstore/petstoreapp/src/main/resources/templates/exception.html b/petstore/petstoreapp/src/main/resources/templates/exception.html new file mode 100644 index 00000000..77ab4ec7 --- /dev/null +++ b/petstore/petstoreapp/src/main/resources/templates/exception.html @@ -0,0 +1,16 @@ + + + + + + +
+
+

+ This generates a sample java.lang.NullPointerException for Telemetry purposes +

+
+
+ + + \ No newline at end of file diff --git a/petstore/petstoreservice/.factorypath b/petstore/petstoreservice/.factorypath deleted file mode 100644 index 2a79cf0d..00000000 --- a/petstore/petstoreservice/.factorypath +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/petstore/petstoreservice/.gitignore b/petstore/petstoreservice/.gitignore deleted file mode 100644 index 5e03c66b..00000000 --- a/petstore/petstoreservice/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -*.class - -# Package Files # -*.jar -*.war -*.ear - -target/ -bin/ - -**/.openapi-generator/ -.openapi-generator-ignore - -#Eclipse files -**/.project -**/.classpath -**/.settings/ -blog/bin/ -**/.tern-project - -#IntelliJ files -**/*.iml -**/.idea -**/.gradle - -#Visual Studio Code files -**/.vscode/ \ No newline at end of file diff --git a/petstore/petstoreservice/Dockerfile b/petstore/petstoreservice/Dockerfile deleted file mode 100644 index cb95b0d9..00000000 --- a/petstore/petstoreservice/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# -# Build stage -# -FROM maven:3.6.0-jdk-8-slim AS build -WORKDIR /build -COPY pom.xml . -COPY src ./src -RUN mvn clean package - -# -# Package stage -# -FROM openjdk:8-jre-alpine -COPY --from=build /build/target/*.jar /app/petstoreservice.jar -EXPOSE 8080 -ENTRYPOINT ["java","-jar","/app/petstoreservice.jar"] diff --git a/petstore/petstoreservice/README.md b/petstore/petstoreservice/README.md deleted file mode 100644 index dd1ed39e..00000000 --- a/petstore/petstoreservice/README.md +++ /dev/null @@ -1,17 +0,0 @@ -PetStoreService is the Back End Java Spring Boot Web Service used in the Azure Pet Store Reference Guide. - -You are also welcome and encouraged to build/deploy it outside of the Azure Pet Store Reference Guide, perhaps on your local developement machine just using Docker in Linux containers mode. - -Build the Spring Boot Jar and Docker Image - -```docker build -t petstoreservice .``` - -Run the Docker Image. Note this example instructs Spring Boot to run on any port of your choice, in this case, 8081 and hence forwards the port to the container accordingly. You are welcome to change this as needed. 8081 or whochever port chosen is ultimatley what the petstoreapp will point to, if/when you choose to run petstoreapp locally as well. - -```docker run --rm --name petstoreservice -p 8081:8081 -e PETSTORESERVICE_SERVER_PORT=8081 -d petstoreservice:latest``` - -Other optional aruments that you can specify to do certain things that get covered in the Azure Pet Store Reference Guide(s) like: - -- enable Application Inisghts (empty and disabled by default, you'll want to uncomment the property in azure-cloud\petstore\petstoreservice\src\main\resources\application.yml - -```-e PETSTORESERVICE_AI_INSTRUMENTATION_KEY=``` diff --git a/petstore/petstoreservice/deployment.yml b/petstore/petstoreservice/deployment.yml deleted file mode 100644 index 1f38382c..00000000 --- a/petstore/petstoreservice/deployment.yml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: petstoreservice -spec: - replicas: 1 - selector: - matchLabels: - app: petstoreservice - template: - metadata: - labels: - app: petstoreservice - spec: - nodeSelector: - "beta.kubernetes.io/os": linux - containers: - - name: petstoreservice - image: azurepetstorecr.azurecr.io/petstoreservice:latest - resources: - requests: - cpu: 100m - memory: 128Mi - limits: - cpu: 250m - memory: 256Mi - ports: - - containerPort: 8080 ---- -apiVersion: v1 -kind: Service -metadata: - name: petstoreservice -spec: - type: LoadBalancer - ports: - - port: 80 - targetPort: 8080 - selector: - app: petstoreservice diff --git a/petstore/petstoreservice/pom.xml b/petstore/petstoreservice/pom.xml deleted file mode 100644 index 18e2faf5..00000000 --- a/petstore/petstoreservice/pom.xml +++ /dev/null @@ -1,157 +0,0 @@ - - 4.0.0 - org.openapitools - openapi-spring - jar - openapi-spring - 1.0.5 - - 1.8 - ${java.version} - ${java.version} - 2.8.0 - - - org.springframework.boot - spring-boot-starter-parent - 2.0.1.RELEASE - - - src/main/java - - - org.springframework.boot - spring-boot-maven-plugin - - - - repackage - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.6 - - - - prepare-agent - - - - report - prepare-package - - report - - - - jacoco-check - - check - - - - - PACKAGE - - - LINE - COVEREDRATIO - 0.00 - - - - - - - - - - - - - com.microsoft.azure - applicationinsights-spring-boot-starter - 2.6.1 - - - - com.microsoft.azure - applicationinsights-logging-logback - 2.6.1 - - - - org.springframework.boot - spring-boot-starter-web - - - org.apache.logging.log4j - log4j-api - - - - - - org.apache.logging.log4j - log4j-api - 2.16.0 - - - - - io.springfox - springfox-swagger2 - ${springfox-version} - - - io.springfox - springfox-swagger-ui - ${springfox-version} - - - javax.xml.bind - jaxb-api - 2.2.11 - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - org.openapitools - jackson-databind-nullable - 0.1.0 - - - - javax.validation - validation-api - - - org.springframework.boot - spring-boot-configuration-processor - true - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - junit - junit - 4.13.2 - test - - - diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/petstore/petstoreservice/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index a551c240..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.openapitools; - -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -import com.fasterxml.jackson.databind.Module; - -@SpringBootApplication -@ComponentScan(basePackages = { "org.openapitools", "org.openapitools.api", "org.openapitools.configuration" }) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /* - * @Override public void addCorsMappings(CorsRegistry registry) { - * registry.addMapping("/**") .allowedOrigins("*") .allowedMethods("*") - * .allowedHeaders("Content-Type"); } - */ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/RFC3339DateFormat.java b/petstore/petstoreservice/src/main/java/org/openapitools/RFC3339DateFormat.java deleted file mode 100644 index 026bb316..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/RFC3339DateFormat.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.util.ISO8601DateFormat; -import com.fasterxml.jackson.databind.util.ISO8601Utils; - -import java.text.FieldPosition; -import java.util.Date; - - -public class RFC3339DateFormat extends ISO8601DateFormat { - - private static final long serialVersionUID = 1L; - - // Same as ISO8601DateFormat but serializing milliseconds. - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - String value = ISO8601Utils.format(date, true); - toAppendTo.append(value); - return toAppendTo; - } - -} \ No newline at end of file diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/api/ApiUtil.java b/petstore/petstoreservice/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 1245b1dd..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.api; - -import org.springframework.web.context.request.NativeWebRequest; - -import javax.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); - } - } -} diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/api/PetApi.java b/petstore/petstoreservice/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index 951631d7..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,284 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.1). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.util.Optional; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; - -import org.openapitools.model.DataPreload; -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Authorization; -import io.swagger.annotations.AuthorizationScope; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -@Validated -@Api(value = "pet", description = "the pet API") -public interface PetApi { - - default Optional getRequest() { - return Optional.empty(); - } - - public DataPreload getBeanToBeAutowired(); - - default List getPreloadedPets() { - return getBeanToBeAutowired().getPets(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid input (status code 405) - */ - @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", }) - @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return Invalid ID supplied (status code 400) or Pet not found (status code - * 404) - */ - @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", }) - @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - default ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status Multiple status values can be - * provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) or Invalid status value - * (status code 400) - */ - @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", produces = { "application/json", - "application/xml" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { - getRequest().ifPresent(request -> { - try { - PetApiController.logger.info(String - .format("PetStoreService incoming GET request to /v2/pet/findPetsByStatus?status=%s", status)); - String petsJSON = new ObjectMapper().writeValueAsString(this.getPreloadedPets()); - ApiUtil.setExampleResponse(request, "application/json", petsJSON); - } catch (JsonProcessingException e) { - e.printStackTrace(); - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - } - }); - - return new ResponseEntity<>(HttpStatus.OK); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags Multiple tags can be provided with - * comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) or Invalid tag value (status - * code 400) - * @deprecated - */ - @Deprecated - @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", produces = { "application/json", - "application/xml" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) or Invalid ID supplied (status - * code 400) or Pet not found (status code 404) - */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") }, tags = { "pet", }) - @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", produces = { "application/json", - "application/xml" }, method = RequestMethod.GET) - default ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid ID supplied (status code 400) or Pet not found (status code - * 404) or Validation exception (status code 405) - */ - @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", }) - @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found"), - @ApiResponse(code = 405, message = "Validation exception") }) - @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", }) - @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", consumes = { - "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @RequestPart(value = "status", required = false) String status) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { - "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/api/PetApiController.java b/petstore/petstoreservice/src/main/java/org/openapitools/api/PetApiController.java deleted file mode 100644 index 5a4f473f..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/api/PetApiController.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.openapitools.api; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Optional; - -import org.openapitools.model.ContainerEnvironment; -import org.openapitools.model.DataPreload; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.MDC; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.context.request.NativeWebRequest; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -@Controller -@RequestMapping("${openapi.swaggerPetstore.base-path:/v2}") -public class PetApiController implements PetApi { - public static Logger logger = LoggerFactory.getLogger(PetApiController.class); - - private final NativeWebRequest request; - - @Autowired - private ContainerEnvironment containerEnvironment; - - @Autowired - private DataPreload dataPreload; - - @Override - public DataPreload getBeanToBeAutowired() { - return dataPreload; - } - - @org.springframework.beans.factory.annotation.Autowired - public PetApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - try { - this.containerEnvironment.setContainerHostName( - InetAddress.getLocalHost().getHostAddress() + "/" + InetAddress.getLocalHost().getHostName()); - } catch (UnknownHostException e) { - e.printStackTrace(); - } - MDC.put("containerHostName", this.containerEnvironment.getContainerHostName()); - MDC.put("session_Id", request.getHeader("session-id")); - return Optional.ofNullable(request); - } - - @RequestMapping(value = "info", produces = { "application/json" }, method = RequestMethod.GET) - public ResponseEntity info() { - // cred scan demo - String password = "foobar"; - logger.info("incoming GET request to /v2/info"); - ApiUtil.setExampleResponse(request, "application/json", - "{ \"version\" : \"" + containerEnvironment.getAppVersion() + "\", \"container\" : \"" - + containerEnvironment.getContainerHostName() + "\" }"); - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/api/StoreApi.java b/petstore/petstoreservice/src/main/java/org/openapitools/api/StoreApi.java deleted file mode 100644 index f7dc8871..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/api/StoreApi.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.1). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -@Validated -@Api(value = "store", description = "the store API") -public interface StoreApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * DELETE /store/order/{orderId} : Delete purchase order by ID - * For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{orderId}", - method = RequestMethod.DELETE) - default ResponseEntity deleteOrder(@Min(1L)@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("orderId") Long orderId) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - */ - @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @Authorization(value = "api_key") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", - produces = { "application/json" }, - method = RequestMethod.GET) - default ResponseEntity> getInventory() { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/order/{orderId} : Find purchase order by ID - * For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{orderId}", - produces = { "application/json", "application/xml" }, - method = RequestMethod.GET) - default ResponseEntity getOrderById(@Min(1L) @Max(10L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("orderId") Long orderId) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : true, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", - produces = { "application/json", "application/xml" }, - consumes = { "application/json" }, - method = RequestMethod.POST) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : true, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/api/StoreApiController.java b/petstore/petstoreservice/src/main/java/org/openapitools/api/StoreApiController.java deleted file mode 100644 index b9c3b1f6..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/api/StoreApiController.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -@Controller -@RequestMapping("${openapi.swaggerPetstore.base-path:/v2}") -public class StoreApiController implements StoreApi { - - private final NativeWebRequest request; - - @org.springframework.beans.factory.annotation.Autowired - public StoreApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/api/UserApi.java b/petstore/petstoreservice/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index 5516b6ca..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,210 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.1). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import org.openapitools.model.User; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -@Validated -@Api(value = "user", description = "the user API") -public interface UserApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", - consumes = { "application/json" }, - method = RequestMethod.POST) - default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", - consumes = { "application/json" }, - method = RequestMethod.POST) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", - consumes = { "application/json" }, - method = RequestMethod.POST) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", - method = RequestMethod.DELETE) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", - produces = { "application/json", "application/xml" }, - method = RequestMethod.GET) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathVariable("username") String username) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", - produces = { "application/json", "application/xml" }, - method = RequestMethod.GET) - default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", - method = RequestMethod.GET) - default ResponseEntity logoutUser() { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be updated (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", - consumes = { "application/json" }, - method = RequestMethod.PUT) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be updated",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/api/UserApiController.java b/petstore/petstoreservice/src/main/java/org/openapitools/api/UserApiController.java deleted file mode 100644 index eb1a451b..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/api/UserApiController.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -@Controller -@RequestMapping("${openapi.swaggerPetstore.base-path:/v2}") -public class UserApiController implements UserApi { - - private final NativeWebRequest request; - - @org.springframework.beans.factory.annotation.Autowired - public UserApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/configuration/HomeController.java b/petstore/petstoreservice/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index 25727830..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui.html"; - } - - -} diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/configuration/MVCConfigurer.java b/petstore/petstoreservice/src/main/java/org/openapitools/configuration/MVCConfigurer.java deleted file mode 100644 index ede2939d..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/configuration/MVCConfigurer.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.filter.CommonsRequestLoggingFilter; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@Configuration -public class MVCConfigurer implements WebMvcConfigurer { - - // logging needs to be DEBUG level - @Bean - public CommonsRequestLoggingFilter logFilter() { - CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter(); - filter.setIncludeQueryString(true); - filter.setIncludePayload(true); - filter.setMaxPayloadLength(10000); - filter.setIncludeHeaders(true); - filter.setAfterMessagePrefix("REQUEST DATA : "); - return filter; - } -} \ No newline at end of file diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/petstore/petstoreservice/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java deleted file mode 100644 index 511a6345..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import org.springframework.web.util.UriComponentsBuilder; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.paths.Paths; -import springfox.documentation.spring.web.paths.RelativePathProvider; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import javax.servlet.ServletContext; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -@Configuration -@EnableSwagger2 -public class OpenAPIDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("Swagger Petstore") - .description("This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") - .license("Apache 2.0") - .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version("1.0.5") - .contact(new Contact("","", "apiteam@swagger.io")) - .build(); - } - - @Bean - public Docket customImplementation(ServletContext servletContext, @Value("${openapi.swaggerPetstore.base-path:/v2}") String basePath) { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) - .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - - class BasePathAwareRelativePathProvider extends RelativePathProvider { - private String basePath; - - public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { - super(servletContext); - this.basePath = basePath; - } - - @Override - protected String applicationPath() { - return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); - } - - @Override - public String getOperationPath(String operationPath) { - UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); - return Paths.removeAdjacentForwardSlashes( - uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); - } - } - -} diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/model/Category.java b/petstore/petstoreservice/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index e8594f4f..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * Category - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -public class Category { - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - @ApiModelProperty(value = "") - - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @ApiModelProperty(value = "") - - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/model/ContainerEnvironment.java b/petstore/petstoreservice/src/main/java/org/openapitools/model/ContainerEnvironment.java deleted file mode 100644 index 43b84d01..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/model/ContainerEnvironment.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.openapitools.model; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.Serializable; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Calendar; - -import javax.annotation.PostConstruct; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.core.io.ClassPathResource; -import org.springframework.stereotype.Component; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.microsoft.applicationinsights.core.dependencies.google.common.io.CharStreams; - -import ch.qos.logback.core.joran.spi.JoranException; - -@SuppressWarnings("serial") -@Component -public class ContainerEnvironment implements Serializable { - private static Logger logger = LoggerFactory.getLogger(ContainerEnvironment.class); - private String containerHostName = null; - private String appVersion = null; - private String appDate = null; - private String year = null; - - @PostConstruct - private void initialize() throws JoranException { - - try { - this.setContainerHostName( - InetAddress.getLocalHost().getHostAddress() + "/" + InetAddress.getLocalHost().getHostName()); - } catch (UnknownHostException e) { - this.setContainerHostName("unknown"); - } - - try { - ObjectMapper objectMapper = new ObjectMapper(); - InputStream resourcee = new ClassPathResource("version.json").getInputStream(); - String text = null; - try (final Reader reader = new InputStreamReader(resourcee)) { - text = CharStreams.toString(reader); - } - - Version version = objectMapper.readValue(text, Version.class); - this.setAppVersion(version.getVersion()); - this.setAppDate(version.getDate()); - } catch (IOException e) { - logger.info("error parsing file " + e.getMessage()); - this.setAppVersion("unknown"); - this.setAppDate("unknown"); - } - - this.setYear(String.valueOf(Calendar.getInstance().get(Calendar.YEAR))); - } - - public String getContainerHostName() { - return containerHostName; - } - - public void setContainerHostName(String containerHostName) { - this.containerHostName = containerHostName; - } - - public String getAppVersion() { - return appVersion; - } - - public void setAppVersion(String appVersion) { - this.appVersion = appVersion; - } - - public String getAppDate() { - return appDate; - } - - public void setAppDate(String appDate) { - this.appDate = appDate; - } - - public String getYear() { - return year; - } - - public void setYear(String year) { - this.year = year; - } -} diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/model/DataPreload.java b/petstore/petstoreservice/src/main/java/org/openapitools/model/DataPreload.java deleted file mode 100644 index b8321628..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/model/DataPreload.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.model; - -import java.util.ArrayList; -import java.util.List; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Configuration; - -@Configuration -@EnableConfigurationProperties -@ConfigurationProperties("data") -public class DataPreload { - private List pets = new ArrayList<>(); - - public List getPets() { - return pets; - } - - public void setPets(List pets) { - this.pets = pets; - } -} \ No newline at end of file diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/model/ModelApiResponse.java b/petstore/petstoreservice/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index 8883b5ba..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,130 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * ModelApiResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -public class ModelApiResponse { - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - @ApiModelProperty(value = "") - - - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @ApiModelProperty(value = "") - - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - @ApiModelProperty(value = "") - - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/model/Order.java b/petstore/petstoreservice/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index dd264bc0..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,246 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import org.openapitools.jackson.nullable.JsonNullable; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * Order - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -public class Order { - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - @ApiModelProperty(value = "") - - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - */ - @ApiModelProperty(value = "") - - - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - */ - @ApiModelProperty(value = "") - - - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - */ - @ApiModelProperty(value = "") - - @Valid - - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - */ - @ApiModelProperty(value = "Order Status") - - - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - */ - @ApiModelProperty(value = "") - - - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/model/Pet.java b/petstore/petstoreservice/src/main/java/org/openapitools/model/Pet.java deleted file mode 100644 index 689088ce..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/model/Pet.java +++ /dev/null @@ -1,255 +0,0 @@ -package org.openapitools.model; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; - -import org.springframework.stereotype.Component; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; - -import io.swagger.annotations.ApiModelProperty; - -/** - * Pet - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -@Component -public class Pet { - @JsonProperty("id") - private Long id; - - @JsonProperty("category") - private Category category; - - @JsonProperty("name") - private String name; - - @JsonProperty("photoURL") - @Valid - private String photoURL; - - @JsonProperty("tags") - @Valid - private List tags = null; - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @ApiModelProperty(value = "") - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * - * @return category - */ - @ApiModelProperty(value = "") - - @Valid - - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name - */ - @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * Get photoUrls - * - * @return photoUrls - */ - @ApiModelProperty(required = true, value = "") - @NotNull - - public String getPhotoURL() { - return photoURL; - } - - public void setPhotoURL(String photoURL) { - this.photoURL = photoURL; - } - - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * - * @return tags - */ - @ApiModelProperty(value = "") - - @Valid - - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * - * @return status - */ - @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && Objects.equals(this.category, pet.category) - && Objects.equals(this.name, pet.name) && Objects.equals(this.photoURL, pet.photoURL) - && Objects.equals(this.tags, pet.tags) && Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoURL, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoURL)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/model/Tag.java b/petstore/petstoreservice/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index 365d34f2..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * Tag - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -public class Tag { - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - @ApiModelProperty(value = "") - - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @ApiModelProperty(value = "") - - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/model/User.java b/petstore/petstoreservice/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index 8466ce62..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,255 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * User - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]") - -public class User { - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - @ApiModelProperty(value = "") - - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - @ApiModelProperty(value = "") - - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - */ - @ApiModelProperty(value = "") - - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - */ - @ApiModelProperty(value = "") - - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - */ - @ApiModelProperty(value = "") - - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - @ApiModelProperty(value = "") - - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - */ - @ApiModelProperty(value = "") - - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - */ - @ApiModelProperty(value = "User Status") - - - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/model/Version.java b/petstore/petstoreservice/src/main/java/org/openapitools/model/Version.java deleted file mode 100644 index 04c9a7d0..00000000 --- a/petstore/petstoreservice/src/main/java/org/openapitools/model/Version.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.openapitools.model; - -import java.io.Serializable; - -@SuppressWarnings("serial") -public class Version implements Serializable { - private String version; - private String date; - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } -} diff --git a/petstore/petstoreservice/src/main/resources/application.yml b/petstore/petstoreservice/src/main/resources/application.yml deleted file mode 100644 index b2d0b7b7..00000000 --- a/petstore/petstoreservice/src/main/resources/application.yml +++ /dev/null @@ -1,344 +0,0 @@ -springfoxdocumentation: - swagger: - v2: - path: /api-docs - -server: - port: ${PETSTORESERVICE_SERVER_PORT:8080} - -spring: - jackson: - date-format: org.openapitools.RFC3339DateFormat - serialization.WRITE_DATES_AS_TIMESTAMPS: false - application: - name: petstoreservice - -#azure: -# application-insights: -# instrumentation-key: ${PETSTORESERVICE_AI_INSTRUMENTATION_KEY} - -management: - endpoints: - web: - exposure: - include: "*" - trace: - http: - enabled: true - endpoint: - httptrace: - enabled: true - -data: - pets: - - id: 1 - category: - id: 1 - name: "Dog" - name: "Afador" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/afador.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 2 - category: - id: 1 - name: "Dog" - name: "American Bulldog" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/american-bulldog.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 3 - category: - id: 1 - name: "Dog" - name: "Australian Retriever" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/australian-retriever.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 4 - category: - id: 1 - name: "Dog" - name: "Australian Shepherd" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/australian-shepherd.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 5 - category: - id: 1 - name: "Dog" - name: "Basset Hound" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/basset-hound.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 6 - category: - id: 1 - name: "Dog" - name: "Beagle" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/beagle.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 7 - category: - id: 1 - name: "Dog" - name: "Border Terrier" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/border-terrier.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 8 - category: - id: 1 - name: "Dog" - name: "Boston Terrier" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/boston-terrier.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 9 - category: - id: 1 - name: "Dog" - name: "Bulldog" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/bulldog.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 10 - category: - id: 1 - name: "Dog" - name: "Bullmastiff" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/bullmastiff.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 11 - category: - id: 1 - name: "Dog" - name: "Chihuahua" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/chihuahua.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 12 - category: - id: 1 - name: "Dog" - name: "Cocker Spaniel" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/cocker-spaniel.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 13 - category: - id: 1 - name: "Dog" - name: "German Sheperd" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/german-shepherd.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 14 - category: - id: 1 - name: "Dog" - name: "Labrador Retriever" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/labrador-retriever.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 15 - category: - id: 1 - name: "Dog" - name: "Pomeranian" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/pomeranian.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 16 - category: - id: 1 - name: "Dog" - name: "Pug" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/pug.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 17 - category: - id: 1 - name: "Dog" - name: "Rottweiler" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/rottweiler.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 18 - category: - id: 1 - name: "Dog" - name: "Shetland Sheepdog" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/shetland-sheepdog.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 19 - category: - id: 1 - name: "Dog" - name: "Shih Tzu" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/shih-tzu.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 20 - category: - id: 1 - name: "Dog" - name: "Toy Fox Terrier" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/toy-fox-terrier.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 21 - category: - id: 1 - name: "Cat" - name: "Abyssinian" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/abyssinian.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 22 - category: - id: 1 - name: "Cat" - name: "American Bobtail" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/american-bobtail.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 23 - category: - id: 1 - name: "Cat" - name: "American Shorthair" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/american-shorthair.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 24 - category: - id: 1 - name: "Cat" - name: "Balinese" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/balinese.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 25 - category: - id: 1 - name: "Cat" - name: "Birman" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/birman.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 26 - category: - id: 1 - name: "Cat" - name: "Bombay" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/bombay.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 27 - category: - id: 1 - name: "Cat" - name: "British Shorthair" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/british-shorthair.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 28 - category: - id: 1 - name: "Cat" - name: "Burmilla" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/burmilla.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 29 - category: - id: 1 - name: "Cat" - name: "Chartreux" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/chartreux.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 30 - category: - id: 1 - name: "Cat" - name: "Cornish Rex" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/cornish-rex.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 31 - category: - id: 1 - name: "Fish" - name: "Goldfish" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/fish-breeds/goldfish.jpg?raw=true" - tags: - - id: 1 - name: "fishy" - status: "available" - diff --git a/petstore/petstoreservice/src/main/resources/application_with_everything_enabled.yml b/petstore/petstoreservice/src/main/resources/application_with_everything_enabled.yml deleted file mode 100644 index def135dd..00000000 --- a/petstore/petstoreservice/src/main/resources/application_with_everything_enabled.yml +++ /dev/null @@ -1,347 +0,0 @@ -springfoxdocumentation: - swagger: - v2: - path: /api-docs - -server: - port: ${PETSTORESERVICE_SERVER_PORT} - -spring: - jackson: - date-format: org.openapitools.RFC3339DateFormat - serialization.WRITE_DATES_AS_TIMESTAMPS: false - application: - name: petstoreservice - -azure: - application-insights: - instrumentation-key: ${PETSTORESERVICE_AI_INSTRUMENTATION_KEY} - web: - enable-W3C: true - enable-W3C-backcompat-mode: true - -management: - endpoints: - web: - exposure: - include: "*" - trace: - http: - enabled: true - endpoint: - httptrace: - enabled: true - -data: - pets: - - id: 1 - category: - id: 1 - name: "Dog" - name: "Afador" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/afador.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 2 - category: - id: 1 - name: "Dog" - name: "American Bulldog" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/american-bulldog.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 3 - category: - id: 1 - name: "Dog" - name: "Australian Retriever" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/australian-retriever.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 4 - category: - id: 1 - name: "Dog" - name: "Australian Shepherd" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/australian-shepherd.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 5 - category: - id: 1 - name: "Dog" - name: "Basset Hound" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/basset-hound.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 6 - category: - id: 1 - name: "Dog" - name: "Beagle" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/beagle.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 7 - category: - id: 1 - name: "Dog" - name: "Border Terrier" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/border-terrier.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 8 - category: - id: 1 - name: "Dog" - name: "Boston Terrier" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/boston-terrier.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 9 - category: - id: 1 - name: "Dog" - name: "Bulldog" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/bulldog.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 10 - category: - id: 1 - name: "Dog" - name: "Bullmastiff" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/bullmastiff.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 11 - category: - id: 1 - name: "Dog" - name: "Chihuahua" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/chihuahua.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 12 - category: - id: 1 - name: "Dog" - name: "Cocker Spaniel" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/cocker-spaniel.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 13 - category: - id: 1 - name: "Dog" - name: "German Sheperd" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/german-shepherd.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 14 - category: - id: 1 - name: "Dog" - name: "Labrador Retriever" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/labrador-retriever.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 15 - category: - id: 1 - name: "Dog" - name: "Pomeranian" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/pomeranian.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 16 - category: - id: 1 - name: "Dog" - name: "Pug" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/pug.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 17 - category: - id: 1 - name: "Dog" - name: "Rottweiler" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/rottweiler.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 18 - category: - id: 1 - name: "Dog" - name: "Shetland Sheepdog" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/shetland-sheepdog.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 19 - category: - id: 1 - name: "Dog" - name: "Shih Tzu" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/shih-tzu.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 20 - category: - id: 1 - name: "Dog" - name: "Toy Fox Terrier" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-breeds/toy-fox-terrier.jpg?raw=true" - tags: - - id: 1 - name: "doggie" - status: "available" - - id: 21 - category: - id: 1 - name: "Cat" - name: "Abyssinian" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/abyssinian.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 22 - category: - id: 1 - name: "Cat" - name: "American Bobtail" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/american-bobtail.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 23 - category: - id: 1 - name: "Cat" - name: "American Shorthair" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/american-shorthair.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 24 - category: - id: 1 - name: "Cat" - name: "Balinese" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/balinese.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 25 - category: - id: 1 - name: "Cat" - name: "Birman" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/birman.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 26 - category: - id: 1 - name: "Cat" - name: "Bombay" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/bombay.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 27 - category: - id: 1 - name: "Cat" - name: "British Shorthair" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/british-shorthair.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 28 - category: - id: 1 - name: "Cat" - name: "Burmilla" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/burmilla.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 29 - category: - id: 1 - name: "Cat" - name: "Chartreux" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/chartreux.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 30 - category: - id: 1 - name: "Cat" - name: "Cornish Rex" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/cat-breeds/cornish-rex.jpg?raw=true" - tags: - - id: 1 - name: "kittie" - status: "available" - - id: 31 - category: - id: 1 - name: "Fish" - name: "Goldfish" - photoURL: "https://raw.githubusercontent.com/chtrembl/staticcontent/master/fish-breeds/goldfish.jpg?raw=true" - tags: - - id: 1 - name: "fishy" - status: "available" - diff --git a/petstore/petstoreservice/src/main/resources/logback-spring.xml b/petstore/petstoreservice/src/main/resources/logback-spring.xml deleted file mode 100644 index 6bf55db0..00000000 --- a/petstore/petstoreservice/src/main/resources/logback-spring.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} application=PetStoreService session_Id=%X{session_Id} containerHostName=%X{containerHostName} | %m%n%wEx - - - - - - - - - \ No newline at end of file diff --git a/petstore/petstoreservice/src/main/resources/version.json b/petstore/petstoreservice/src/main/resources/version.json deleted file mode 100644 index 3186bfbb..00000000 --- a/petstore/petstoreservice/src/main/resources/version.json +++ /dev/null @@ -1 +0,0 @@ -{"version":"version1","date":"date1"} \ No newline at end of file diff --git a/petstore/petstoreservice/src/test/java/org/openapitools/api/TestingWebApplicationTests.java b/petstore/petstoreservice/src/test/java/org/openapitools/api/TestingWebApplicationTests.java deleted file mode 100644 index 905010dd..00000000 --- a/petstore/petstoreservice/src/test/java/org/openapitools/api/TestingWebApplicationTests.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.openapitools.api; - -import static org.hamcrest.Matchers.containsString; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; - -@RunWith(SpringRunner.class) -@SpringBootTest -@AutoConfigureMockMvc -public class TestingWebApplicationTests { - - @Autowired - private MockMvc mockMvc; - - @Test - public void shouldReturnVersion() throws Exception { - this.mockMvc.perform(get("/v2/info")).andDo(print()).andExpect(status().isOk()) - .andExpect(content().string(containsString("version"))); - } -} \ No newline at end of file diff --git a/petstore/petstoreservice/src/test/resources/application.yml b/petstore/petstoreservice/src/test/resources/application.yml deleted file mode 100644 index e135a275..00000000 --- a/petstore/petstoreservice/src/test/resources/application.yml +++ /dev/null @@ -1,26 +0,0 @@ -springfoxdocumentation: - swagger: - v2: - path: /api-docs - -server: - port: 8080 - -spring: - jackson: - date-format: org.openapitools.RFC3339DateFormat - serialization.WRITE_DATES_AS_TIMESTAMPS: false - application: - name: petstoreservice - -management: - endpoints: - web: - exposure: - include: "*" - trace: - http: - enabled: true - endpoint: - httptrace: - enabled: true \ No newline at end of file