diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
new file mode 100644
index 0000000..fff59aa
--- /dev/null
+++ b/.github/workflows/maven.yml
@@ -0,0 +1,35 @@
+# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
+
+# This workflow uses actions that are not certified by GitHub.
+# They are provided by a third-party and are governed by
+# separate terms of service, privacy policy, and support
+# documentation.
+
+name: Java CI with Maven
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ java: [ '17', '21' ]
+ name: Build with Java ${{ matrix.Java }}
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up JDK
+ uses: actions/setup-java@v3
+ with:
+ distribution: 'temurin'
+ java-version: ${{ matrix.java }}
+ cache: maven
+ - name: Build with Maven
+ run: |
+ mvn -v
+ mvn -B package --file pom.xml
diff --git a/.gitignore b/.gitignore
index dabc478..c6c98eb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,7 @@ tmp/
hs_err_pid*
# IntelliJ IDEA
+**/*.iml
**/.idea/artifacts/
**/.idea/codeStyles/
**/.idea/dictionaries/
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 8e0adbb..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: java
-
-# this uses Ubuntu 18.04 (Bionic Beaver) as environment, with JDK openjdk11 and maven 3.6.0
-dist: bionic
-
-script: mvn verify
diff --git a/README.adoc b/README.adoc
index fccd70c..0746086 100644
--- a/README.adoc
+++ b/README.adoc
@@ -1,6 +1,6 @@
= OpenAPI - code first or design first?
-image:https://travis-ci.org/pe-st/apidocs.svg?branch=master["Build Status", link="https://travis-ci.org/pe-st/apidocs"]
+image:https://github.com/pe-st/apidocs/actions/workflows/maven/badge.svg?branch=feature%2Fupdates["Build Status"]
== Overview
@@ -16,13 +16,12 @@ between the design-first and code-first approach.
Accompanying presentation at https://www.eclipsecon.org/europe2019[eclipsecon Europe 2019] :
https://www.eclipsecon.org/europe2019/sessions/microprofile-openapi-code-first-or-design-first[MicroProfile OpenAPI - code first or design first?]
-The examples use https://quarkus.io/[Quarkus] and https://openliberty.io/[OpenLiberty] as servers
-just because they not only support MicroProfile OpenAPI, but come also with an integrated UI.
+The examples use https://quarkus.io/[Quarkus] as server
+just because it not only supports MicroProfile OpenAPI, but comes also with an integrated UI.
But the examples should run with very few code changes in any MicroProfile compatible server.
=== Code First
-* link:code-first-openapi-openliberty/README.md[code-first with OpenLiberty server and MicroProfile OpenAPI]
* link:code-first-openapi-quarkus/README.md[code-first with Quarkus server and MicroProfile OpenAPI]
* link:code-first-swagger/README.md[code-first with Swagger scanner running with Quarkus server]
@@ -30,7 +29,6 @@ But the examples should run with very few code changes in any MicroProfile compa
* link:design-first-openapi-generator/README.md[design-first with OpenAPI Generator and Quarkus server]
* link:design-first-swagger-quarkus/README.md[design-first with Swagger Codegen and Quarkus server]
-* link:design-first-swagger-openliberty/README.md[design-first with Swagger Codegen and OpenLiberty server]
== Project Structure
@@ -48,7 +46,7 @@ when the project dependencies are updated (like it happened when I updated from
(the txt suffix protects them from being recognized as Java files by the IDE and being reformatted),
allowing to compare the result of openapi-generator and swagger-codegen.
-In addition all example projects have a `rest-api.http` file which allows to run some example HTTP
+In addition, all example projects have a `rest-api.http` file which allows to run some example HTTP
request against a running service directly from within IntelliJ. And there is an `_idea` directory
containing the IntelliJ project setup. But you can import the projects easily in any IDE with Maven
support.
@@ -89,4 +87,3 @@ Code, Documentation and Annotations generated from the same information
** https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md[OpenAPI Specification (OpenAPI Initiative)]
** https://swagger.io/specification/[OpenAPI Specification (Swagger)]
* https://quarkus.io/guides/openapi-swaggerui-guide[Quarkus - Using OpenAPI and Swagger UI]
-* https://openliberty.io/guides/microprofile-openapi.html[OpenLiberty Guide - Documenting RESTful APIs]
diff --git a/_idea/.idea/_idea.iml b/_idea/.idea/_idea.iml
deleted file mode 100644
index d6ebd48..0000000
--- a/_idea/.idea/_idea.iml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/_idea/.idea/compiler.xml b/_idea/.idea/compiler.xml
index 38f6db0..6d843b1 100644
--- a/_idea/.idea/compiler.xml
+++ b/_idea/.idea/compiler.xml
@@ -7,12 +7,10 @@
-
+
-
-
diff --git a/_idea/.idea/encodings.xml b/_idea/.idea/encodings.xml
index 4d7edf6..435c934 100644
--- a/_idea/.idea/encodings.xml
+++ b/_idea/.idea/encodings.xml
@@ -2,12 +2,22 @@
-
+
+
+
+
+
+
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_idea/.idea/misc.xml b/_idea/.idea/misc.xml
index cce673c..26df1c0 100644
--- a/_idea/.idea/misc.xml
+++ b/_idea/.idea/misc.xml
@@ -101,6 +101,7 @@
+
@@ -154,7 +155,7 @@
-
+
\ No newline at end of file
diff --git a/_idea/.idea/runConfigurations/All_in_design_first_swagger_openliberty.xml b/_idea/.idea/runConfigurations/All_in_design_first_swagger_openliberty.xml
deleted file mode 100644
index 083d795..0000000
--- a/_idea/.idea/runConfigurations/All_in_design_first_swagger_openliberty.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/_idea/.idea/runConfigurations/GenerationTest__swagger_openliberty_.xml b/_idea/.idea/runConfigurations/GenerationTest__swagger_openliberty_.xml
deleted file mode 100644
index f62a97a..0000000
--- a/_idea/.idea/runConfigurations/GenerationTest__swagger_openliberty_.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/_idea/.idea/runConfigurations/code_first_openapi_openliberty__liberty_dev_.xml b/_idea/.idea/runConfigurations/all__verify_.xml
similarity index 67%
rename from _idea/.idea/runConfigurations/code_first_openapi_openliberty__liberty_dev_.xml
rename to _idea/.idea/runConfigurations/all__verify_.xml
index e98e9ae..48e39fd 100644
--- a/_idea/.idea/runConfigurations/code_first_openapi_openliberty__liberty_dev_.xml
+++ b/_idea/.idea/runConfigurations/all__verify_.xml
@@ -1,24 +1,28 @@
-
+
+
-
+
+
+
+
-
+
diff --git a/_idea/.idea/runConfigurations/code_first_openapi_openliberty__clean_install_liberty_run_.xml b/_idea/.idea/runConfigurations/code_first_openapi_openliberty__clean_install_liberty_run_.xml
deleted file mode 100644
index 43cb1d8..0000000
--- a/_idea/.idea/runConfigurations/code_first_openapi_openliberty__clean_install_liberty_run_.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/_idea/.idea/runConfigurations/code_first_openapi_openliberty__install_liberty_run_w_o_tests_.xml b/_idea/.idea/runConfigurations/code_first_openapi_openliberty__install_liberty_run_w_o_tests_.xml
deleted file mode 100644
index e578a63..0000000
--- a/_idea/.idea/runConfigurations/code_first_openapi_openliberty__install_liberty_run_w_o_tests_.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/_idea/.idea/runConfigurations/design_first_swagger_openliberty__liberty_dev_.xml b/_idea/.idea/runConfigurations/design_first_swagger_openliberty__liberty_dev_.xml
deleted file mode 100644
index 818ab3c..0000000
--- a/_idea/.idea/runConfigurations/design_first_swagger_openliberty__liberty_dev_.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/code-first-openapi-openliberty/README.md b/code-first-openapi-openliberty/README.md
deleted file mode 100644
index 9cbf849..0000000
--- a/code-first-openapi-openliberty/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# OpenAPI code-first approach with OpenLiberty
-
-This directory contains a simple service implemented
-
-- using the *code-first* approach to provide an OpenAPI document
-- running with [OpenLiberty](https://openliberty.io/)'s
- MicroProfile [OpenAPI implementation](https://openliberty.io/guides/microprofile-openapi.html)
-
-For more information consult the [README](../README.adoc) in the parent directory.
-
-## How to run the service
-
-Using OpenLiberty's [dev mode](https://openliberty.io/blog/2019/10/17/dev-mode-developer-experience.html):
-
- mvn liberty:dev
-
-Once the service runs:
-
-- http://localhost:8080/openapi fetches the OpenAPI document
-- http://localhost:8080/openapi/ui shows an interactive view of the API (based on Swagger-UI)
diff --git a/code-first-openapi-openliberty/pom.xml b/code-first-openapi-openliberty/pom.xml
deleted file mode 100755
index 2fdcc5f..0000000
--- a/code-first-openapi-openliberty/pom.xml
+++ /dev/null
@@ -1,286 +0,0 @@
-
-
- 4.0.0
-
- ch.schlau.pesche.apidocs
- code-first-openapi-openliberty
- 0.9-SNAPSHOT
- war
-
- apidocs.${project.artifactId}
-
-
- UTF-8
-
-
-
- 11
-
-
- 1.18.10
- 19.0.0.10
-
-
- 5.5.2
- 2.2
- 2.10.0
- 4.1.2
- 2.6
- 2.10.0
- 1.0.5
- 1.1.4
-
-
- 3.1
- 3.8.1
- 2.22.2
- 2.22.2
- 3.2.3
-
-
- 8080
- 8443
-
-
-
-
-
- io.openliberty.features
- features-bom
- ${openliberty.version}
- pom
- import
-
-
-
-
-
-
-
- io.openliberty.features
- jaxrs-2.1
- esa
- provided
-
-
- io.openliberty.features
- jsonp-1.1
- esa
- provided
-
-
- io.openliberty.features
- jsonb-1.0
- esa
- provided
-
-
- io.openliberty.features
- cdi-2.0
- esa
- provided
-
-
- io.openliberty.features
- beanValidation-2.0
- esa
- provided
-
-
- io.openliberty.features
- mpConfig-1.3
- esa
- provided
-
-
- io.openliberty.features
- mpOpenAPI-1.1
- esa
- provided
-
-
-
-
- org.projectlombok
- lombok
- ${lombok.version}
- provided
-
-
-
-
- org.junit.jupiter
- junit-jupiter
- ${junit.jupiter.version}
- test
-
-
- org.hamcrest
- hamcrest
- ${hamcrest.version}
- test
-
-
-
- org.glassfish
- javax.json
- ${glassfish.javax.json.version}
- test
-
-
-
- org.eclipse
- yasson
- ${yasson.version}
- test
-
-
- io.rest-assured
- rest-assured
- ${restassured.version}
- test
-
-
- com.sun.xml.bind
- jaxb-osgi
-
-
-
-
- net.javacrumbs.json-unit
- json-unit
- ${json.unit.version}
- test
-
-
- commons-io
- commons-io
- ${commons-io.version}
- test
-
-
- com.fasterxml.jackson.core
- jackson-databind
- ${jackson-2-version}
- test
-
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-yaml
- ${jackson-2-version}
- test
-
-
-
-
-
-
- io.openliberty.tools
- liberty-maven-plugin
- ${liberty.plugin.version}
-
-
- io.openliberty
- openliberty-runtime
- ${openliberty.version}
- zip
-
- usr
-
- ${liberty.http.port}
- ${liberty.https.port}
-
-
-
-
- install-liberty
- prepare-package
-
- install-server
-
-
-
- create-default-server
- prepare-package
-
- create
-
-
-
- install-app
- package
-
- deploy
-
-
- apps
- true
-
-
-
- start-server
- pre-integration-test
-
- test-start
-
-
-
- stop-server
- post-integration-test
-
- test-stop
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- ${maven.compiler.plugin.version}
-
-
- ${java.release}
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- ${maven.surefire.plugin.version}
-
-
- org.apache.maven.plugins
- maven-failsafe-plugin
- ${maven.failsafe.plugin.version}
-
-
- integration-test
- integration-test
-
- integration-test
-
-
-
- ${liberty.http.port}
-
-
-
-
- verify-results
-
- verify
-
-
-
-
-
- org.apache.maven.plugins
- maven-war-plugin
- ${maven.war.plugin.version}
-
- false
-
-
-
-
-
diff --git a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JaxrsApplication.java b/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JaxrsApplication.java
deleted file mode 100644
index a611465..0000000
--- a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JaxrsApplication.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.rest;
-
-import javax.ws.rs.ApplicationPath;
-import javax.ws.rs.core.Application;
-
-import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition;
-import org.eclipse.microprofile.openapi.annotations.info.Info;
-
-@OpenAPIDefinition(info = @Info(title = "txproc-code-first-openapi", version = "0.9"))
-@ApplicationPath("/api")
-public class JaxrsApplication extends Application {
-}
diff --git a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonConfiguration.java b/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonConfiguration.java
deleted file mode 100644
index 8920fd5..0000000
--- a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonConfiguration.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.rest;
-
-import javax.json.bind.Jsonb;
-import javax.json.bind.JsonbBuilder;
-import javax.json.bind.JsonbConfig;
-
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model.PanJsonAdapter;
-import lombok.experimental.UtilityClass;
-
-@UtilityClass
-public class JsonConfiguration {
-
- public static final JsonbConfig JSON_CONFIG = new JsonbConfig()
- .withAdapters(new PanJsonAdapter())
- ;
-
- public static final Jsonb JSONB = JsonbBuilder.create(JSON_CONFIG);
-}
\ No newline at end of file
diff --git a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonContextResolver.java b/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonContextResolver.java
deleted file mode 100644
index f0b6307..0000000
--- a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonContextResolver.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.rest;
-
-import static ch.schlau.pesche.apidocs.openapi.codefirst.rest.JsonConfiguration.JSONB;
-
-import javax.json.bind.Jsonb;
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.Provider;
-
-@Provider
-public class JsonContextResolver implements ContextResolver {
-
- private final Jsonb jsonb;
-
- public JsonContextResolver() {
- jsonb = JSONB;
- }
-
- @Override
- public Jsonb getContext(Class> type) {
- return jsonb;
- }
-}
diff --git a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProc.java b/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProc.java
deleted file mode 100644
index 97582d4..0000000
--- a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProc.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.rest;
-
-import java.util.Optional;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import org.eclipse.microprofile.openapi.annotations.Operation;
-import org.eclipse.microprofile.openapi.annotations.media.Content;
-import org.eclipse.microprofile.openapi.annotations.media.Schema;
-import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody;
-import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
-
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.PinCheckRequest;
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.PinCheckResponse;
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.PurchaseAuthRequest;
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.PurchaseAuthResponse;
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model.EmvTags;
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model.Pan;
-
-@Path("/txproc")
-@Consumes(MediaType.APPLICATION_JSON)
-@Produces(MediaType.APPLICATION_JSON)
-public class TxProc {
-
- @Path("/pincheck")
- @POST
- @Operation(summary = "Check the pin")
- @APIResponse(description = "PIN Check Response",
- content = @Content(schema = @Schema(implementation = PinCheckResponse.class)))
- public PinCheckResponse pinCheck(
- @RequestBody(description = "PIN Check Request Body",
- content = @Content(schema = @Schema(implementation = PinCheckRequest.class)),
- required = true
- ) PinCheckRequest request) {
-
- PinCheckResponse response = new PinCheckResponse();
- if ("magic".equals(request.getPinBlock())) {
- response.setResult(PinCheckResponse.Code.OK);
- response.setTries(3);
- } else {
- response.setResult(PinCheckResponse.Code.WRONG);
- }
- return response;
- }
-
- @Path("/purchase")
- @POST
- @Operation(summary = "Authorize a Purchase")
- @APIResponse(description = "Purchase Response",
- content = @Content(schema = @Schema(implementation = PurchaseAuthResponse.class)))
- public PurchaseAuthResponse purchase(
- @RequestBody(description = "Purchase Request Body",
- content = @Content(schema = @Schema(implementation = PurchaseAuthRequest.class)),
- required = true
- ) PurchaseAuthRequest request) {
-
- PurchaseAuthResponse response = new PurchaseAuthResponse();
- if (Optional.ofNullable(request.getPan())
- .map(Pan::getPan)
- .filter(s -> s.startsWith("42"))
- .isPresent()) {
- response.setResult(PurchaseAuthResponse.Code.OK);
- response.setApprovalCode("OK42." +
- Optional.ofNullable(request.getEmvTags()).map(EmvTags::getX9F1A).orElse("756"));
- } else {
- response.setResult(PurchaseAuthResponse.Code.WRONG);
- }
- return response;
- }
-
-}
diff --git a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckRequest.java b/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckRequest.java
deleted file mode 100644
index bf3e8c5..0000000
--- a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckRequest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.txproc;
-
-import java.util.UUID;
-
-import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
-import org.eclipse.microprofile.openapi.annotations.media.Schema;
-
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.doc.Model;
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model.Pan;
-import lombok.Getter;
-import lombok.Setter;
-
-@Schema(description = "Request for checking a PIN",
- requiredProperties = {"uuid", "pan", "pinBlock"})
-@Getter
-@Setter
-public class PinCheckRequest {
-
- @Schema(type = SchemaType.STRING, description = Model.UUID)
- private UUID uuid;
-
- // the class Pan already carries a @Schema annotation
- private Pan pan;
-
- @Schema(description = Model.PIN_BLOCK)
- private String pinBlock;
-}
diff --git a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckResponse.java b/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckResponse.java
deleted file mode 100644
index d06d02d..0000000
--- a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckResponse.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.txproc;
-
-import org.eclipse.microprofile.openapi.annotations.media.Schema;
-
-import lombok.Getter;
-import lombok.Setter;
-
-@Schema(description = "Tells if the PIN in the request was correct")
-@Getter
-@Setter
-public class PinCheckResponse {
-
- // can't put @Schema annotation on the enum for OpenLiberty
- public enum Code {
- OK,
- WRONG
- }
-
- @Schema(description = "Result of the request")
- private Code result;
-
- @Schema(description = "Number of remaining tries")
- private int tries;
-}
diff --git a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthRequest.java b/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthRequest.java
deleted file mode 100644
index 1c03c05..0000000
--- a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthRequest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.txproc;
-
-import java.util.UUID;
-
-import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
-import org.eclipse.microprofile.openapi.annotations.media.Schema;
-
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.doc.Model;
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model.EmvTags;
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model.Pan;
-import lombok.Getter;
-import lombok.Setter;
-
-@Schema(description = "Request for authorizing a Purchase",
- requiredProperties = {"uuid", "pan"})
-@Getter
-@Setter
-public class PurchaseAuthRequest {
-
- @Schema(type = SchemaType.STRING, description = Model.UUID)
- private UUID uuid;
-
- // the class Pan already carries a @Schema annotation
- private Pan pan;
-
- // the class EmvTags already carries a @Schema annotation
- private EmvTags emvTags;
-}
diff --git a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthResponse.java b/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthResponse.java
deleted file mode 100644
index 0ae23bf..0000000
--- a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthResponse.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.txproc;
-
-import org.eclipse.microprofile.openapi.annotations.media.Schema;
-
-import lombok.Getter;
-import lombok.Setter;
-
-@Schema(description = "Response to PurchaseAuthRequest")
-@Getter
-@Setter
-public class PurchaseAuthResponse {
-
- public enum Code {
- OK,
- WRONG
- }
-
- @Schema(description = "Result of the request")
- private Code result;
-
- @Schema(description = "Code referencing the successful authorization")
- private String approvalCode;
-}
diff --git a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/doc/Model.java b/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/doc/Model.java
deleted file mode 100644
index 5d2c498..0000000
--- a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/doc/Model.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.txproc.doc;
-
-import lombok.experimental.UtilityClass;
-
-/**
- * Centralized strings for use with [org.eclipse.microprofile.openapi.annotations.media.Schema]
- * annotations
- */
-@UtilityClass
-public class Model {
-
- public static final String UUID = "Unique ID of the request";
-
- public static final String PIN_BLOCK = "Encrypted binary data containing a PIN"
- + "\n\nFieldcode: C003";
-
-}
diff --git a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTags.java b/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTags.java
deleted file mode 100644
index 6dd9b2d..0000000
--- a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTags.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model;
-
-import javax.json.bind.annotation.JsonbProperty;
-
-import org.eclipse.microprofile.openapi.annotations.media.Schema;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * In the real world this would probably be a Map of enum with all the known tags
- */
-@Schema(title = "EmvTags", description = "Collection of EMV tags")
-@Getter
-@Setter
-public class EmvTags {
-
- @JsonbProperty("84")
- @Schema(name = "84", title = "Dedicated Filename", description = "The EMV AID as reported by ICC")
- private String x84;
-
- // no `@JsonbProperty("9F1A")` to observe if the openapi scanner considers the `name`
- @Schema(name = "9F1A", description = "Terminal Country Code")
- private String x9F1A;
-}
diff --git a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/Pan.java b/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/Pan.java
deleted file mode 100644
index ba241d9..0000000
--- a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/Pan.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model;
-
-import javax.validation.constraints.Pattern;
-
-import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
-import org.eclipse.microprofile.openapi.annotations.media.Schema;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-@Schema(title = "PAN (Primary Account Number)",
- description = "The number embossed on credit cards",
- type = SchemaType.STRING)
-@Getter
-@Setter
-@AllArgsConstructor
-@NoArgsConstructor
-public class Pan {
-
- @Pattern(regexp = "[0-9]{12,19}")
- private String pan;
-
- /**
- * For data protection reasons (PCI-DSS compliance) the complete PAN must not
- * be shown unless absolutely needed. This method masks out the middle digits
- * of the PAN, allowing the result to be safely displayed (e.g. on receipts)
- *
- * @return PAN with the middle digits safely replaced by 'x' characters
- */
- public String asMaskedPan() {
- if (pan != null && pan.length() >= 12 && pan.length() <= 19) {
- int lastPos = pan.length() - 4;
- return new StringBuilder(pan).replace(6, lastPos, "xxxxxxxxxxxxxxxxxxx".substring(0, lastPos - 6)).toString();
- } else {
- return pan;
- }
- }
-}
diff --git a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanJsonAdapter.java b/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanJsonAdapter.java
deleted file mode 100644
index 9852212..0000000
--- a/code-first-openapi-openliberty/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanJsonAdapter.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model;
-
-import javax.json.bind.adapter.JsonbAdapter;
-
-public class PanJsonAdapter implements JsonbAdapter {
- @Override
- public String adaptToJson(Pan pan) throws Exception {
- return pan.getPan();
- }
-
- @Override
- public Pan adaptFromJson(String s) throws Exception {
- return new Pan(s);
- }
-}
diff --git a/code-first-openapi-openliberty/src/main/liberty/config/server.xml b/code-first-openapi-openliberty/src/main/liberty/config/server.xml
deleted file mode 100644
index 5296b40..0000000
--- a/code-first-openapi-openliberty/src/main/liberty/config/server.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- jaxrs-2.1
- jsonp-1.1
- jsonb-1.0
- cdi-2.0
- beanValidation-2.0
- mpConfig-1.3
- mpOpenAPI-1.1
-
-
-
-
-
-
-
-
-
diff --git a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/OpenapiDocumentIT.java b/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/OpenapiDocumentIT.java
deleted file mode 100644
index 6e31261..0000000
--- a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/OpenapiDocumentIT.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst;
-
-import static com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature.MINIMIZE_QUOTES;
-import static io.restassured.RestAssured.given;
-import static io.restassured.RestAssured.when;
-import static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertAll;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.commons.io.IOUtils;
-import org.junit.jupiter.api.Test;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
-
-import lombok.Getter;
-import lombok.Setter;
-
-class OpenapiDocumentIT {
-
- @Getter
- @Setter
- static class OpenapiSkeleton {
- String openapi;
- Object info;
- Object servers;
- Object paths;
- Object components;
- Object security;
- Object tags;
- Object externalDocs;
- }
-
- @Test
- void openapi_yaml() throws IOException {
-
- String expected = loadResourceFile("openapi.yaml");
- String expectedSorted = loadResourceFile("openapi-sorted.yaml");
-
- String document = when().get("/openapi")
- .then()
- .statusCode(200)
- .extract().response().asString();
-
- String yamlSorted = sortYaml(document);
-
- assertAll("openapi yaml"
- // the unsorted document with OpenLiberty has no deterministic order
- // , () -> assertThat("unsorted", document, is(expected))
- , () -> assertThat("sorted", yamlSorted, is(expectedSorted))
- );
- }
-
- @Test
- void openapi_json() throws IOException {
-
- String expected = loadResourceFile("openapi.json");
-
- String document = given().accept(MediaType.APPLICATION_JSON)
- .when().get("/openapi")
- .then()
- .statusCode(200)
- .assertThat().contentType(MediaType.APPLICATION_JSON)
- .extract().response().asString();
-
- assertThat(document, jsonEquals(expected));
- }
-
- private String sortYaml(String yaml) throws IOException {
- ObjectMapper yamlMapper = new ObjectMapper(new YAMLFactory().enable(MINIMIZE_QUOTES));
- OpenapiSkeleton objFromYaml = yamlMapper.readValue(yaml, OpenapiSkeleton.class);
-
- ObjectMapper jsonMapper = new ObjectMapper()
- .setSerializationInclusion(JsonInclude.Include.NON_NULL)
- .configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
- String jsonSorted = jsonMapper.writeValueAsString(objFromYaml);
- Object objFromJson = jsonMapper.readValue(jsonSorted, Object.class);
-
- return yamlMapper.writeValueAsString(objFromJson);
- }
-
- private String loadResourceFile(String s) throws IOException {
- return IOUtils.toString(getClass().getClassLoader().getResourceAsStream(s), StandardCharsets.UTF_8)
- // needed on Windows depending on the Git configuration (core.autocrlf)
- .replace("\r\n", "\n");
- }
-}
diff --git a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPincheckIT.java b/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPincheckIT.java
deleted file mode 100644
index fc271f3..0000000
--- a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPincheckIT.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.rest;
-
-import static io.restassured.RestAssured.given;
-import static org.hamcrest.CoreMatchers.is;
-
-import javax.ws.rs.core.MediaType;
-
-import org.junit.jupiter.api.Test;
-
-class TxProcPincheckIT {
-
- @Test
- void pincheck_ok() {
- // @formatter:off
- given()
- .header("Content-Type", MediaType.APPLICATION_JSON)
- .body("{\"uuid\": \"aaaaaaaa-bbbb-cccc-dddd-012345678901\", \"pinBlock\": \"magic\"}")
- .when()
- .post("/api/txproc/pincheck")
- .then()
- .statusCode(200)
- .body("result", is("OK"))
- .body("tries", is(3))
- ;
- // @formatter:off
- }
-}
diff --git a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPurchaseIT.java b/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPurchaseIT.java
deleted file mode 100644
index 417d034..0000000
--- a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPurchaseIT.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.rest;
-
-import static io.restassured.RestAssured.given;
-import static org.hamcrest.CoreMatchers.is;
-
-import javax.ws.rs.core.MediaType;
-
-import org.junit.jupiter.api.Test;
-
-class TxProcPurchaseIT {
-
- @Test
- void purchase_ok() {
- // @formatter:off
- given()
- .header("Content-Type", MediaType.APPLICATION_JSON)
- .body("{\"uuid\": \"aaaaaaaa-bbbb-cccc-dddd-012345678901\","
- +" \"pan\": \"4244333322221111\","
- +" \"emvTags\": { \"84\": \"A0000000041010\", \"x9F1A\": \"250\" } }")
- .when()
- .post("/api/txproc/purchase")
- .then()
- .statusCode(200)
- .body("result", is("OK"))
- .body("approvalCode", is("OK42.250"))
- ;
- // @formatter:off
- }
-}
\ No newline at end of file
diff --git a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckRequestTest.java b/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckRequestTest.java
deleted file mode 100644
index 559a087..0000000
--- a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckRequestTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.txproc;
-
-import static ch.schlau.pesche.apidocs.openapi.codefirst.rest.JsonConfiguration.JSONB;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import java.util.UUID;
-
-import org.junit.jupiter.api.Test;
-
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model.Pan;
-
-class PinCheckRequestTest {
-
- @Test
- void json_roundtrip() {
-
- PinCheckRequest request = new PinCheckRequest();
- request.setUuid(UUID.fromString("abcdabcd-1234-5678-aaaa-cccccccccccc"));
-
- // JSON serialization
- String jsonString1 = JSONB.toJson(request);
- assertThat(jsonString1, is("{\"uuid\":\"abcdabcd-1234-5678-aaaa-cccccccccccc\"}"));
-
- // set the other properties as well
- request.setPan(new Pan("111222333444"));
- request.setPinBlock("-secret-");
- String jsonString2 = JSONB.toJson(request);
- assertThat(jsonString2, is("{\"pan\":\"111222333444\",\"pinBlock\":\"-secret-\",\"uuid\":\"abcdabcd-1234-5678-aaaa-cccccccccccc\"}"));
-
- // JSON deserialization
- PinCheckRequest roundtrip = JSONB.fromJson(jsonString2, PinCheckRequest.class);
- assertThat(roundtrip.getUuid().toString(), is("abcdabcd-1234-5678-aaaa-cccccccccccc"));
- assertThat(roundtrip.getPan().getPan(), is("111222333444"));
- assertThat(roundtrip.getPinBlock(), is("-secret-"));
- }
-}
diff --git a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthRequestTest.java b/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthRequestTest.java
deleted file mode 100644
index fc448af..0000000
--- a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthRequestTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.txproc;
-
-import static ch.schlau.pesche.apidocs.openapi.codefirst.rest.JsonConfiguration.JSONB;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import java.util.UUID;
-
-import org.junit.jupiter.api.Test;
-
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model.EmvTags;
-import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model.Pan;
-
-class PurchaseAuthRequestTest {
-
- @Test
- void json_roundtrip() {
-
- PurchaseAuthRequest request = new PurchaseAuthRequest();
- request.setUuid(UUID.fromString("abcdabcd-1234-5678-aaaa-cccccccccccc"));
- request.setPan(new Pan("42"));
- var emvTags = new EmvTags();
- emvTags.setX84("A0000000041010");
- request.setEmvTags(emvTags);
-
- // JSON serialization
- String jsonString = JSONB.toJson(request);
- assertThat(jsonString, is("{\"emvTags\":{\"84\":\"A0000000041010\"},\"pan\":\"42\",\"uuid\":\"abcdabcd-1234-5678-aaaa-cccccccccccc\"}"));
-
- // JSON deserialization
- PurchaseAuthRequest roundtrip = JSONB.fromJson(jsonString, PurchaseAuthRequest.class);
- assertThat(roundtrip.getUuid().toString(), is("abcdabcd-1234-5678-aaaa-cccccccccccc"));
- }
-}
\ No newline at end of file
diff --git a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTagsTest.java b/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTagsTest.java
deleted file mode 100644
index 1fb8daa..0000000
--- a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTagsTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model;
-
-import static ch.schlau.pesche.apidocs.openapi.codefirst.rest.JsonConfiguration.JSONB;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import javax.json.bind.Jsonb;
-
-import org.junit.jupiter.api.Test;
-
-class EmvTagsTest {
-
- @Test
- void json_roundtrip() {
-
- Jsonb jsonb = JSONB;
-
- EmvTags emv = new EmvTags();
- emv.setX84("A0000000043060");
-
- // JSON serialization
- String jsonString = jsonb.toJson(emv);
- assertThat(jsonString, is("{\"84\":\"A0000000043060\"}"));
-
- // JSON deserialization
- EmvTags roundtrip = jsonb.fromJson(jsonString, EmvTags.class);
- assertThat(roundtrip.getX84(), is("A0000000043060"));
- }
-}
\ No newline at end of file
diff --git a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanTest.java b/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanTest.java
deleted file mode 100644
index 4602499..0000000
--- a/code-first-openapi-openliberty/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model;
-
-import static ch.schlau.pesche.apidocs.openapi.codefirst.rest.JsonConfiguration.JSONB;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import javax.json.bind.Jsonb;
-
-import org.junit.jupiter.api.Test;
-
-class PanTest {
-
- @Test
- void asMaskedPan_valid() {
-
- assertThat(new Pan("123456789012").asMaskedPan(), is("123456xx9012"));
- assertThat(new Pan("1234567890123456789").asMaskedPan(), is("123456xxxxxxxxx6789"));
- }
-
- @Test
- void asMaskedPan_invalid() {
-
- assertThat(new Pan(null).asMaskedPan(), is(nullValue()));
- assertThat(new Pan("1234567890").asMaskedPan(), is("1234567890"));
- assertThat(new Pan("12345678901234567890").asMaskedPan(), is("12345678901234567890"));
- }
-
- @Test
- void json_roundtrip() {
-
- Jsonb jsonb = JSONB;
-
- Pan pan = new Pan("4444333322221111");
-
- // JSON serialization
- String jsonString = jsonb.toJson(pan);
- assertThat(jsonString, is("\"4444333322221111\""));
-
- // JSON deserialization
- Pan roundtrip = jsonb.fromJson(jsonString, Pan.class);
- assertThat(roundtrip.getPan(), is("4444333322221111"));
- }
-}
\ No newline at end of file
diff --git a/code-first-openapi-openliberty/src/test/resources/openapi.json b/code-first-openapi-openliberty/src/test/resources/openapi.json
deleted file mode 100644
index a2a2321..0000000
--- a/code-first-openapi-openliberty/src/test/resources/openapi.json
+++ /dev/null
@@ -1,176 +0,0 @@
-{
- "components": {
- "schemas": {
- "EmvTags": {
- "description": "Collection of EMV tags",
- "properties": {
- "84": {
- "description": "The EMV AID as reported by ICC",
- "title": "Dedicated Filename",
- "type": "string"
- },
- "9F1A": {
- "description": "Terminal Country Code",
- "type": "string"
- }
- },
- "title": "EmvTags",
- "type": "object"
- },
- "PinCheckRequest": {
- "description": "Request for checking a PIN",
- "properties": {
- "pan": {
- "description": "The number embossed on credit cards",
- "title": "PAN (Primary Account Number)",
- "type": "string"
- },
- "pinBlock": {
- "description": "Encrypted binary data containing a PIN\n\nFieldcode: C003",
- "type": "string"
- },
- "uuid": {
- "description": "Unique ID of the request",
- "format": "uuid",
- "type": "string"
- }
- },
- "required": [
- "pan",
- "pinBlock",
- "uuid"
- ],
- "type": "object"
- },
- "PinCheckResponse": {
- "description": "Tells if the PIN in the request was correct",
- "properties": {
- "result": {
- "description": "Result of the request",
- "enum": [
- "OK",
- "WRONG"
- ],
- "type": "string"
- },
- "tries": {
- "description": "Number of remaining tries",
- "type": "integer"
- }
- },
- "type": "object"
- },
- "PurchaseAuthRequest": {
- "description": "Request for authorizing a Purchase",
- "properties": {
- "emvTags": {
- "$ref": "#/components/schemas/EmvTags"
- },
- "pan": {
- "description": "The number embossed on credit cards",
- "title": "PAN (Primary Account Number)",
- "type": "string"
- },
- "uuid": {
- "description": "Unique ID of the request",
- "format": "uuid",
- "type": "string"
- }
- },
- "required": [
- "pan",
- "uuid"
- ],
- "type": "object"
- },
- "PurchaseAuthResponse": {
- "description": "Response to PurchaseAuthRequest",
- "properties": {
- "approvalCode": {
- "description": "Code referencing the successful authorization",
- "type": "string"
- },
- "result": {
- "description": "Result of the request",
- "enum": [
- "OK",
- "WRONG"
- ],
- "type": "string"
- }
- },
- "type": "object"
- }
- }
- },
- "info": {
- "title": "txproc-code-first-openapi",
- "version": "0.9"
- },
- "openapi": "3.0.0",
- "paths": {
- "/api/txproc/pincheck": {
- "post": {
- "operationId": "pinCheck",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PinCheckRequest"
- }
- }
- },
- "description": "PIN Check Request Body",
- "required": true
- },
- "responses": {
- "default": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PinCheckResponse"
- }
- }
- },
- "description": "PIN Check Response"
- }
- },
- "summary": "Check the pin"
- }
- },
- "/api/txproc/purchase": {
- "post": {
- "operationId": "purchase",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PurchaseAuthRequest"
- }
- }
- },
- "description": "Purchase Request Body",
- "required": true
- },
- "responses": {
- "default": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PurchaseAuthResponse"
- }
- }
- },
- "description": "Purchase Response"
- }
- },
- "summary": "Authorize a Purchase"
- }
- }
- },
- "servers": [
- {
- "url": "http://localhost:8080"
- }
- ]
-}
diff --git a/code-first-openapi-openliberty/src/test/resources/rest-api.http b/code-first-openapi-openliberty/src/test/resources/rest-api.http
deleted file mode 100644
index 78acf50..0000000
--- a/code-first-openapi-openliberty/src/test/resources/rest-api.http
+++ /dev/null
@@ -1,35 +0,0 @@
-# Swagger/OpenAPI in YAML format
-GET http://localhost:8080/openapi
-
-###
-
-# Swagger/OpenAPI in JSON format
-GET http://localhost:8080/openapi
-Accept: application/json
-
-###
-
-POST http://localhost:8080/api/txproc/pincheck
-Content-Type: application/json
-
-{
- "uuid": "aaaaaaaa-bbbb-cccc-dddd-012345678901",
- "pan" : "100000000042",
- "pinBlock": "magic"
-}
-
-###
-
-POST http://localhost:8080/api/txproc/purchase
-Content-Type: application/json
-
-{
- "uuid": "aaaaaaaa-bbbb-cccc-dddd-012345678901",
- "pan": "4244333322221111",
- "emvTags": {
- "84" : "A0000000041010",
- "x9F1A" : "250"
- }
-}
-
-###
diff --git a/code-first-openapi-quarkus/.editorconfig b/code-first-openapi-quarkus/.editorconfig
new file mode 100644
index 0000000..222d8e4
--- /dev/null
+++ b/code-first-openapi-quarkus/.editorconfig
@@ -0,0 +1,19 @@
+# editor configuration containing values that are different from the IntelliJ default
+
+[*]
+charset = utf-8
+indent_size = 4
+indent_style = space
+
+[*.java]
+ij_java_imports_layout = $*, |, java.**, |, jakarta.**, javax.**, |, oracle.**, |, org.**, |, com.**, |, *
+
+[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.rng,*.tld,*.wadl,*.wsdd,*.wsdl,*.xjb,*.xml,*.xsd,*.xsl,*.xslt,*.xul}]
+ij_xml_line_comment_at_first_column = false
+
+[{*.har,*.jsb2,*.jsb3,*.json,*.ndjson,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}]
+indent_size = 2
+
+[{*.yaml,*.yml}]
+indent_size = 2
+ij_yaml_indent_sequence_value = false
diff --git a/code-first-openapi-quarkus/pom.xml b/code-first-openapi-quarkus/pom.xml
index 6f60381..a04690c 100755
--- a/code-first-openapi-quarkus/pom.xml
+++ b/code-first-openapi-quarkus/pom.xml
@@ -14,19 +14,19 @@
- 11
+ 17
- 1.18.10
- 0.25.0
+ 1.18.30
+ 3.5.0
2.2
- 2.10.0
+ 3.2.2
- 3.8.1
- 2.22.2
+ 3.11.0
+ 3.2.1
@@ -42,7 +42,7 @@
-
+
io.quarkus
quarkus-resteasy-jsonb
@@ -90,6 +90,13 @@
${json.unit.version}
test
+
+
+
+ io.quarkus
+ quarkus-smallrye-openapi-deployment
+ test
+
@@ -113,6 +120,13 @@
${java.release}
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+
+
@@ -120,9 +134,9 @@
maven-surefire-plugin
${maven.surefire.plugin.version}
-
+
org.jboss.logmanager.LogManager
-
+
**/*Test.java
diff --git a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JaxrsApplication.java b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JaxrsApplication.java
index a611465..748104e 100644
--- a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JaxrsApplication.java
+++ b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JaxrsApplication.java
@@ -1,7 +1,7 @@
package ch.schlau.pesche.apidocs.openapi.codefirst.rest;
-import javax.ws.rs.ApplicationPath;
-import javax.ws.rs.core.Application;
+import jakarta.ws.rs.ApplicationPath;
+import jakarta.ws.rs.core.Application;
import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition;
import org.eclipse.microprofile.openapi.annotations.info.Info;
diff --git a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonConfiguration.java b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonConfiguration.java
index 8920fd5..0389554 100644
--- a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonConfiguration.java
+++ b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonConfiguration.java
@@ -1,8 +1,8 @@
package ch.schlau.pesche.apidocs.openapi.codefirst.rest;
-import javax.json.bind.Jsonb;
-import javax.json.bind.JsonbBuilder;
-import javax.json.bind.JsonbConfig;
+import jakarta.json.bind.Jsonb;
+import jakarta.json.bind.JsonbBuilder;
+import jakarta.json.bind.JsonbConfig;
import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model.PanJsonAdapter;
import lombok.experimental.UtilityClass;
diff --git a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonContextResolver.java b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonContextResolver.java
index f0b6307..4046be1 100644
--- a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonContextResolver.java
+++ b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/JsonContextResolver.java
@@ -2,9 +2,9 @@
import static ch.schlau.pesche.apidocs.openapi.codefirst.rest.JsonConfiguration.JSONB;
-import javax.json.bind.Jsonb;
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.Provider;
+import jakarta.json.bind.Jsonb;
+import jakarta.ws.rs.ext.ContextResolver;
+import jakarta.ws.rs.ext.Provider;
@Provider
public class JsonContextResolver implements ContextResolver {
diff --git a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProc.java b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProc.java
index 97582d4..a5c6d6f 100644
--- a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProc.java
+++ b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProc.java
@@ -2,11 +2,11 @@
import java.util.Optional;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
import org.eclipse.microprofile.openapi.annotations.Operation;
import org.eclipse.microprofile.openapi.annotations.media.Content;
diff --git a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckRequest.java b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckRequest.java
index bf3e8c5..eb9abca 100644
--- a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckRequest.java
+++ b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckRequest.java
@@ -2,7 +2,8 @@
import java.util.UUID;
-import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
+import jakarta.validation.constraints.NotNull;
+
import org.eclipse.microprofile.openapi.annotations.media.Schema;
import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.doc.Model;
@@ -10,18 +11,20 @@
import lombok.Getter;
import lombok.Setter;
-@Schema(description = "Request for checking a PIN",
- requiredProperties = {"uuid", "pan", "pinBlock"})
+@Schema(description = "Request for checking a PIN")
@Getter
@Setter
public class PinCheckRequest {
- @Schema(type = SchemaType.STRING, description = Model.UUID)
+ @Schema(description = Model.UUID)
+ @NotNull
private UUID uuid;
// the class Pan already carries a @Schema annotation
+ @NotNull
private Pan pan;
@Schema(description = Model.PIN_BLOCK)
+ @NotNull
private String pinBlock;
}
diff --git a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckResponse.java b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckResponse.java
index acd2f78..f7cf9ba 100644
--- a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckResponse.java
+++ b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PinCheckResponse.java
@@ -10,13 +10,13 @@
@Setter
public class PinCheckResponse {
- // can't put @Schema annotation on the enum for Quarkus
+ @Schema(description = "Result of the request")
public enum Code {
OK,
WRONG
}
- @Schema(description = "Result of the request")
+ // the enum Code already carries a @Schema annotation
private Code result;
@Schema(description = "Number of remaining tries")
diff --git a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthRequest.java b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthRequest.java
index 1c03c05..16100b1 100644
--- a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthRequest.java
+++ b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthRequest.java
@@ -2,7 +2,8 @@
import java.util.UUID;
-import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
+import jakarta.validation.constraints.NotNull;
+
import org.eclipse.microprofile.openapi.annotations.media.Schema;
import ch.schlau.pesche.apidocs.openapi.codefirst.txproc.doc.Model;
@@ -11,16 +12,17 @@
import lombok.Getter;
import lombok.Setter;
-@Schema(description = "Request for authorizing a Purchase",
- requiredProperties = {"uuid", "pan"})
+@Schema(description = "Request for authorizing a Purchase")
@Getter
@Setter
public class PurchaseAuthRequest {
- @Schema(type = SchemaType.STRING, description = Model.UUID)
+ @Schema(description = Model.UUID)
+ @NotNull
private UUID uuid;
// the class Pan already carries a @Schema annotation
+ @NotNull
private Pan pan;
// the class EmvTags already carries a @Schema annotation
diff --git a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthResponse.java b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthResponse.java
index 0ae23bf..172bb10 100644
--- a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthResponse.java
+++ b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/PurchaseAuthResponse.java
@@ -10,12 +10,13 @@
@Setter
public class PurchaseAuthResponse {
+ @Schema(description = "Result of the request")
public enum Code {
OK,
WRONG
}
- @Schema(description = "Result of the request")
+ // the enum Code already carries a @Schema annotation
private Code result;
@Schema(description = "Code referencing the successful authorization")
diff --git a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/doc/Model.java b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/doc/Model.java
index 5d2c498..601c49b 100644
--- a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/doc/Model.java
+++ b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/doc/Model.java
@@ -11,7 +11,9 @@ public class Model {
public static final String UUID = "Unique ID of the request";
- public static final String PIN_BLOCK = "Encrypted binary data containing a PIN"
- + "\n\nFieldcode: C003";
+ public static final String PIN_BLOCK = """
+ Encrypted binary data containing a PIN
+
+ Fieldcode: C003""";
}
diff --git a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTags.java b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTags.java
index 6dd9b2d..f481404 100644
--- a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTags.java
+++ b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTags.java
@@ -1,6 +1,6 @@
package ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model;
-import javax.json.bind.annotation.JsonbProperty;
+import jakarta.json.bind.annotation.JsonbProperty;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
diff --git a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/Pan.java b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/Pan.java
index ba241d9..db4e2a5 100644
--- a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/Pan.java
+++ b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/Pan.java
@@ -1,6 +1,6 @@
package ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model;
-import javax.validation.constraints.Pattern;
+import jakarta.validation.constraints.Pattern;
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
diff --git a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanJsonAdapter.java b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanJsonAdapter.java
index 9852212..524146f 100644
--- a/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanJsonAdapter.java
+++ b/code-first-openapi-quarkus/src/main/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanJsonAdapter.java
@@ -1,6 +1,6 @@
package ch.schlau.pesche.apidocs.openapi.codefirst.txproc.model;
-import javax.json.bind.adapter.JsonbAdapter;
+import jakarta.json.bind.adapter.JsonbAdapter;
public class PanJsonAdapter implements JsonbAdapter {
@Override
diff --git a/code-first-openapi-quarkus/src/main/resources/META-INF/microprofile-config.properties b/code-first-openapi-quarkus/src/main/resources/META-INF/microprofile-config.properties
index 7a8727f..cb0d7d6 100644
--- a/code-first-openapi-quarkus/src/main/resources/META-INF/microprofile-config.properties
+++ b/code-first-openapi-quarkus/src/main/resources/META-INF/microprofile-config.properties
@@ -1,7 +1,6 @@
# Smallrye-specific options
-# I tried to set this option, because nested classes like EmvTags are not
-# referenced, but copied inline, see also https://github.com/smallrye/smallrye-open-api/issues/73
-# but this option then references all classes, also String and Integer
-# mp.openapi.extensions.schema-references.enable = true
+mp.openapi.extensions.smallrye.operationIdStrategy=METHOD
-# mp.openapi.scan.packages = ch.schlau.pesche.apidocs.openapi.codefirst.txproc
+# keep /openapi instead /q/openapi for the time being
+# see https://quarkus.io/blog/path-resolution-in-quarkus/
+quarkus.http.non-application-root-path=${quarkus.http.root-path}
diff --git a/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/OpenapiDocumentIT.java b/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/OpenapiDocumentIT.java
index 0b92b92..c2b646b 100644
--- a/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/OpenapiDocumentIT.java
+++ b/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/OpenapiDocumentIT.java
@@ -11,7 +11,7 @@
import java.io.IOException;
import java.nio.charset.StandardCharsets;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MediaType;
import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.Test;
@@ -44,8 +44,8 @@ static class OpenapiSkeleton {
@Test
void openapi_yaml() throws IOException {
- String expected = loadResourceFile("openapi.yaml");
- String expectedSorted = loadResourceFile("openapi-sorted.yaml");
+ String expected = loadResourceFile("openapi.yaml.txt");
+ String expectedSorted = loadResourceFile("openapi-sorted.yaml.txt");
String document = when().get("/openapi")
.then()
@@ -63,7 +63,7 @@ void openapi_yaml() throws IOException {
@Test
void openapi_json() throws IOException {
- String expected = loadResourceFile("openapi.json");
+ String expected = loadResourceFile("openapi.json.txt");
String document = given().accept(MediaType.APPLICATION_JSON)
.when().get("/openapi")
@@ -72,7 +72,7 @@ void openapi_json() throws IOException {
.assertThat().contentType(MediaType.APPLICATION_JSON)
.extract().response().asString();
- assertThat(document, jsonEquals(expected));
+ assertThat("actual: " + document, document, jsonEquals(expected));
}
private String sortYaml(String yaml) throws IOException {
diff --git a/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPincheckIT.java b/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPincheckIT.java
index 7e43adb..6ce1c1c 100644
--- a/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPincheckIT.java
+++ b/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPincheckIT.java
@@ -3,7 +3,7 @@
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MediaType;
import org.junit.jupiter.api.Test;
diff --git a/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPurchaseIT.java b/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPurchaseIT.java
index d9bb04f..9ec1b2b 100644
--- a/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPurchaseIT.java
+++ b/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/rest/TxProcPurchaseIT.java
@@ -3,7 +3,7 @@
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MediaType;
import org.junit.jupiter.api.Test;
diff --git a/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTagsTest.java b/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTagsTest.java
index 1fb8daa..bcf27e8 100644
--- a/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTagsTest.java
+++ b/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/EmvTagsTest.java
@@ -4,7 +4,7 @@
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
-import javax.json.bind.Jsonb;
+import jakarta.json.bind.Jsonb;
import org.junit.jupiter.api.Test;
diff --git a/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanTest.java b/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanTest.java
index 4602499..1f06054 100644
--- a/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanTest.java
+++ b/code-first-openapi-quarkus/src/test/java/ch/schlau/pesche/apidocs/openapi/codefirst/txproc/model/PanTest.java
@@ -5,7 +5,7 @@
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
-import javax.json.bind.Jsonb;
+import jakarta.json.bind.Jsonb;
import org.junit.jupiter.api.Test;
diff --git a/code-first-openapi-quarkus/src/test/resources/openapi-sorted.yaml b/code-first-openapi-quarkus/src/test/resources/openapi-sorted.yaml
deleted file mode 100644
index 8c2e8bd..0000000
--- a/code-first-openapi-quarkus/src/test/resources/openapi-sorted.yaml
+++ /dev/null
@@ -1,148 +0,0 @@
----
-openapi: 3.0.1
-info:
- title: txproc-code-first-openapi
- version: 0.9
-paths:
- /api/txproc/pincheck:
- post:
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PinCheckRequest'
- description: PIN Check Request Body
- required: true
- responses:
- default:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PinCheckResponse'
- description: PIN Check Response
- summary: Check the pin
- /api/txproc/purchase:
- post:
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PurchaseAuthRequest'
- description: Purchase Request Body
- required: true
- responses:
- default:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PurchaseAuthResponse'
- description: Purchase Response
- summary: Authorize a Purchase
-components:
- schemas:
- PinCheckRequest:
- description: Request for checking a PIN
- properties:
- pan:
- description: The number embossed on credit cards
- properties:
- pan:
- type: string
- title: PAN (Primary Account Number)
- type: string
- pinBlock:
- description: |-
- Encrypted binary data containing a PIN
-
- Fieldcode: C003
- type: string
- uuid:
- description: Unique ID of the request
- properties:
- leastSigBits:
- format: int64
- type: integer
- leastSignificantBits:
- format: int64
- type: integer
- mostSigBits:
- format: int64
- type: integer
- mostSignificantBits:
- format: int64
- type: integer
- type: object
- required:
- - uuid
- - pan
- - pinBlock
- type: object
- PinCheckResponse:
- description: Tells if the PIN in the request was correct
- properties:
- result:
- description: Result of the request
- enum:
- - OK
- - WRONG
- type: string
- tries:
- description: Number of remaining tries
- format: int32
- type: integer
- type: object
- PurchaseAuthRequest:
- description: Request for authorizing a Purchase
- properties:
- emvTags:
- description: Collection of EMV tags
- properties:
- 84:
- description: The EMV AID as reported by ICC
- title: Dedicated Filename
- type: string
- 9F1A:
- description: Terminal Country Code
- type: string
- title: EmvTags
- type: object
- pan:
- description: The number embossed on credit cards
- properties:
- pan:
- type: string
- title: PAN (Primary Account Number)
- type: string
- uuid:
- description: Unique ID of the request
- properties:
- leastSigBits:
- format: int64
- type: integer
- leastSignificantBits:
- format: int64
- type: integer
- mostSigBits:
- format: int64
- type: integer
- mostSignificantBits:
- format: int64
- type: integer
- type: object
- required:
- - uuid
- - pan
- type: object
- PurchaseAuthResponse:
- description: Response to PurchaseAuthRequest
- properties:
- approvalCode:
- description: Code referencing the successful authorization
- type: string
- result:
- description: Result of the request
- enum:
- - OK
- - WRONG
- type: string
- type: object
diff --git a/design-first-swagger-openliberty/src/test/resources/openapi-sorted.yaml b/code-first-openapi-quarkus/src/test/resources/openapi-sorted.yaml.txt
similarity index 80%
rename from design-first-swagger-openliberty/src/test/resources/openapi-sorted.yaml
rename to code-first-openapi-quarkus/src/test/resources/openapi-sorted.yaml.txt
index e6a9464..29d8a32 100644
--- a/design-first-swagger-openliberty/src/test/resources/openapi-sorted.yaml
+++ b/code-first-openapi-quarkus/src/test/resources/openapi-sorted.yaml.txt
@@ -1,10 +1,8 @@
---
-openapi: 3.0.0
+openapi: 3.0.3
info:
- title: txproc-design-first-swagger-openliberty
+ title: txproc-code-first-openapi
version: 0.9
-servers:
-- url: http://localhost:8080
paths:
/api/txproc/pincheck:
post:
@@ -24,6 +22,8 @@ paths:
$ref: '#/components/schemas/PinCheckResponse'
description: PIN Check Response
summary: Check the pin
+ tags:
+ - Tx Proc
/api/txproc/purchase:
post:
operationId: purchase
@@ -42,8 +42,22 @@ paths:
$ref: '#/components/schemas/PurchaseAuthResponse'
description: Purchase Response
summary: Authorize a Purchase
+ tags:
+ - Tx Proc
components:
schemas:
+ Code:
+ description: Result of the request
+ enum:
+ - OK
+ - WRONG
+ type: string
+ Code1:
+ description: Result of the request
+ enum:
+ - OK
+ - WRONG
+ type: string
EmvTags:
description: Collection of EMV tags
properties:
@@ -58,9 +72,8 @@ components:
type: object
Pan:
description: The number embossed on credit cards
- format: string
title: PAN (Primary Account Number)
- type: object
+ type: string
PinCheckRequest:
description: Request for checking a PIN
properties:
@@ -73,23 +86,20 @@ components:
Fieldcode: C003
type: string
uuid:
+ allOf:
+ - $ref: '#/components/schemas/UUID'
description: Unique ID of the request
- format: uuid
type: string
required:
+ - uuid
- pan
- pinBlock
- - uuid
type: object
PinCheckResponse:
description: Tells if the PIN in the request was correct
properties:
result:
- description: Result of the request
- enum:
- - OK
- - WRONG
- type: string
+ $ref: '#/components/schemas/Code'
tries:
description: Number of remaining tries
format: int32
@@ -103,12 +113,13 @@ components:
pan:
$ref: '#/components/schemas/Pan'
uuid:
+ allOf:
+ - $ref: '#/components/schemas/UUID'
description: Unique ID of the request
- format: uuid
type: string
required:
- - pan
- uuid
+ - pan
type: object
PurchaseAuthResponse:
description: Response to PurchaseAuthRequest
@@ -117,9 +128,9 @@ components:
description: Code referencing the successful authorization
type: string
result:
- description: Result of the request
- enum:
- - OK
- - WRONG
- type: string
+ $ref: '#/components/schemas/Code1'
type: object
+ UUID:
+ format: uuid
+ pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"
+ type: string
diff --git a/code-first-openapi-quarkus/src/test/resources/openapi.json b/code-first-openapi-quarkus/src/test/resources/openapi.json
deleted file mode 100644
index 0ba0cd7..0000000
--- a/code-first-openapi-quarkus/src/test/resources/openapi.json
+++ /dev/null
@@ -1,211 +0,0 @@
-{
- "components": {
- "schemas": {
- "PinCheckRequest": {
- "description": "Request for checking a PIN",
- "properties": {
- "pan": {
- "description": "The number embossed on credit cards",
- "properties": {
- "pan": {
- "type": "string"
- }
- },
- "title": "PAN (Primary Account Number)",
- "type": "string"
- },
- "pinBlock": {
- "description": "Encrypted binary data containing a PIN\n\nFieldcode: C003",
- "type": "string"
- },
- "uuid": {
- "description": "Unique ID of the request",
- "properties": {
- "leastSigBits": {
- "format": "int64",
- "type": "integer"
- },
- "leastSignificantBits": {
- "format": "int64",
- "type": "integer"
- },
- "mostSigBits": {
- "format": "int64",
- "type": "integer"
- },
- "mostSignificantBits": {
- "format": "int64",
- "type": "integer"
- }
- },
- "type": "object"
- }
- },
- "required": [
- "uuid",
- "pan",
- "pinBlock"
- ],
- "type": "object"
- },
- "PinCheckResponse": {
- "description": "Tells if the PIN in the request was correct",
- "properties": {
- "result": {
- "description": "Result of the request",
- "enum": [
- "OK",
- "WRONG"
- ],
- "type": "string"
- },
- "tries": {
- "description": "Number of remaining tries",
- "format": "int32",
- "type": "integer"
- }
- },
- "type": "object"
- },
- "PurchaseAuthRequest": {
- "description": "Request for authorizing a Purchase",
- "properties": {
- "emvTags": {
- "description": "Collection of EMV tags",
- "properties": {
- "84": {
- "description": "The EMV AID as reported by ICC",
- "title": "Dedicated Filename",
- "type": "string"
- },
- "9F1A": {
- "description": "Terminal Country Code",
- "type": "string"
- }
- },
- "title": "EmvTags",
- "type": "object"
- },
- "pan": {
- "description": "The number embossed on credit cards",
- "properties": {
- "pan": {
- "type": "string"
- }
- },
- "title": "PAN (Primary Account Number)",
- "type": "string"
- },
- "uuid": {
- "description": "Unique ID of the request",
- "properties": {
- "leastSigBits": {
- "format": "int64",
- "type": "integer"
- },
- "leastSignificantBits": {
- "format": "int64",
- "type": "integer"
- },
- "mostSigBits": {
- "format": "int64",
- "type": "integer"
- },
- "mostSignificantBits": {
- "format": "int64",
- "type": "integer"
- }
- },
- "type": "object"
- }
- },
- "required": [
- "uuid",
- "pan"
- ],
- "type": "object"
- },
- "PurchaseAuthResponse": {
- "description": "Response to PurchaseAuthRequest",
- "properties": {
- "approvalCode": {
- "description": "Code referencing the successful authorization",
- "type": "string"
- },
- "result": {
- "description": "Result of the request",
- "enum": [
- "OK",
- "WRONG"
- ],
- "type": "string"
- }
- },
- "type": "object"
- }
- }
- },
- "info": {
- "title": "txproc-code-first-openapi",
- "version": "0.9"
- },
- "openapi": "3.0.1",
- "paths": {
- "/api/txproc/pincheck": {
- "post": {
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PinCheckRequest"
- }
- }
- },
- "description": "PIN Check Request Body",
- "required": true
- },
- "responses": {
- "default": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PinCheckResponse"
- }
- }
- },
- "description": "PIN Check Response"
- }
- },
- "summary": "Check the pin"
- }
- },
- "/api/txproc/purchase": {
- "post": {
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PurchaseAuthRequest"
- }
- }
- },
- "description": "Purchase Request Body",
- "required": true
- },
- "responses": {
- "default": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PurchaseAuthResponse"
- }
- }
- },
- "description": "Purchase Response"
- }
- },
- "summary": "Authorize a Purchase"
- }
- }
- }
-}
diff --git a/code-first-openapi-quarkus/src/test/resources/openapi.json.txt b/code-first-openapi-quarkus/src/test/resources/openapi.json.txt
new file mode 100644
index 0000000..b809030
--- /dev/null
+++ b/code-first-openapi-quarkus/src/test/resources/openapi.json.txt
@@ -0,0 +1,177 @@
+{
+ "openapi" : "3.0.3",
+ "info" : {
+ "title" : "txproc-code-first-openapi",
+ "version" : "0.9"
+ },
+ "paths" : {
+ "/api/txproc/pincheck" : {
+ "post" : {
+ "tags" : [ "Tx Proc" ],
+ "summary" : "Check the pin",
+ "operationId" : "pinCheck",
+ "requestBody" : {
+ "description" : "PIN Check Request Body",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PinCheckRequest"
+ }
+ }
+ },
+ "required" : true
+ },
+ "responses" : {
+ "default" : {
+ "description" : "PIN Check Response",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PinCheckResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/txproc/purchase" : {
+ "post" : {
+ "tags" : [ "Tx Proc" ],
+ "summary" : "Authorize a Purchase",
+ "operationId" : "purchase",
+ "requestBody" : {
+ "description" : "Purchase Request Body",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PurchaseAuthRequest"
+ }
+ }
+ },
+ "required" : true
+ },
+ "responses" : {
+ "default" : {
+ "description" : "Purchase Response",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PurchaseAuthResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components" : {
+ "schemas" : {
+ "Code" : {
+ "description" : "Result of the request",
+ "enum" : [ "OK", "WRONG" ],
+ "type" : "string"
+ },
+ "Code1" : {
+ "description" : "Result of the request",
+ "enum" : [ "OK", "WRONG" ],
+ "type" : "string"
+ },
+ "EmvTags" : {
+ "title" : "EmvTags",
+ "description" : "Collection of EMV tags",
+ "type" : "object",
+ "properties" : {
+ "84" : {
+ "title" : "Dedicated Filename",
+ "description" : "The EMV AID as reported by ICC",
+ "type" : "string"
+ },
+ "9F1A" : {
+ "description" : "Terminal Country Code",
+ "type" : "string"
+ }
+ }
+ },
+ "Pan" : {
+ "title" : "PAN (Primary Account Number)",
+ "description" : "The number embossed on credit cards",
+ "type" : "string"
+ },
+ "PinCheckRequest" : {
+ "description" : "Request for checking a PIN",
+ "required" : [ "uuid", "pan", "pinBlock" ],
+ "type" : "object",
+ "properties" : {
+ "uuid" : {
+ "description" : "Unique ID of the request",
+ "type" : "string",
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/UUID"
+ } ]
+ },
+ "pan" : {
+ "$ref" : "#/components/schemas/Pan"
+ },
+ "pinBlock" : {
+ "description" : "Encrypted binary data containing a PIN\n\nFieldcode: C003",
+ "type" : "string"
+ }
+ }
+ },
+ "PinCheckResponse" : {
+ "description" : "Tells if the PIN in the request was correct",
+ "type" : "object",
+ "properties" : {
+ "result" : {
+ "$ref" : "#/components/schemas/Code"
+ },
+ "tries" : {
+ "format" : "int32",
+ "description" : "Number of remaining tries",
+ "type" : "integer"
+ }
+ }
+ },
+ "PurchaseAuthRequest" : {
+ "description" : "Request for authorizing a Purchase",
+ "required" : [ "uuid", "pan" ],
+ "type" : "object",
+ "properties" : {
+ "uuid" : {
+ "description" : "Unique ID of the request",
+ "type" : "string",
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/UUID"
+ } ]
+ },
+ "pan" : {
+ "$ref" : "#/components/schemas/Pan"
+ },
+ "emvTags" : {
+ "$ref" : "#/components/schemas/EmvTags"
+ }
+ }
+ },
+ "PurchaseAuthResponse" : {
+ "description" : "Response to PurchaseAuthRequest",
+ "type" : "object",
+ "properties" : {
+ "result" : {
+ "$ref" : "#/components/schemas/Code1"
+ },
+ "approvalCode" : {
+ "description" : "Code referencing the successful authorization",
+ "type" : "string"
+ }
+ }
+ },
+ "UUID" : {
+ "format" : "uuid",
+ "pattern" : "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
+ "type" : "string"
+ }
+ }
+ }
+}
diff --git a/code-first-openapi-quarkus/src/test/resources/openapi.yaml b/code-first-openapi-quarkus/src/test/resources/openapi.yaml
deleted file mode 100644
index e372630..0000000
--- a/code-first-openapi-quarkus/src/test/resources/openapi.yaml
+++ /dev/null
@@ -1,148 +0,0 @@
----
-openapi: 3.0.1
-info:
- title: txproc-code-first-openapi
- version: "0.9"
-paths:
- /api/txproc/pincheck:
- post:
- summary: Check the pin
- requestBody:
- description: PIN Check Request Body
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PinCheckRequest'
- required: true
- responses:
- default:
- description: PIN Check Response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PinCheckResponse'
- /api/txproc/purchase:
- post:
- summary: Authorize a Purchase
- requestBody:
- description: Purchase Request Body
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PurchaseAuthRequest'
- required: true
- responses:
- default:
- description: Purchase Response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PurchaseAuthResponse'
-components:
- schemas:
- PinCheckRequest:
- description: Request for checking a PIN
- required:
- - uuid
- - pan
- - pinBlock
- type: object
- properties:
- pan:
- title: PAN (Primary Account Number)
- description: The number embossed on credit cards
- type: string
- properties:
- pan:
- type: string
- pinBlock:
- description: |-
- Encrypted binary data containing a PIN
-
- Fieldcode: C003
- type: string
- uuid:
- description: Unique ID of the request
- type: object
- properties:
- leastSigBits:
- format: int64
- type: integer
- mostSigBits:
- format: int64
- type: integer
- leastSignificantBits:
- format: int64
- type: integer
- mostSignificantBits:
- format: int64
- type: integer
- PinCheckResponse:
- description: Tells if the PIN in the request was correct
- type: object
- properties:
- result:
- description: Result of the request
- enum:
- - OK
- - WRONG
- type: string
- tries:
- format: int32
- description: Number of remaining tries
- type: integer
- PurchaseAuthRequest:
- description: Request for authorizing a Purchase
- required:
- - uuid
- - pan
- type: object
- properties:
- emvTags:
- title: EmvTags
- description: Collection of EMV tags
- type: object
- properties:
- 84:
- title: Dedicated Filename
- description: The EMV AID as reported by ICC
- type: string
- 9F1A:
- description: Terminal Country Code
- type: string
- pan:
- title: PAN (Primary Account Number)
- description: The number embossed on credit cards
- type: string
- properties:
- pan:
- type: string
- uuid:
- description: Unique ID of the request
- type: object
- properties:
- leastSigBits:
- format: int64
- type: integer
- mostSigBits:
- format: int64
- type: integer
- leastSignificantBits:
- format: int64
- type: integer
- mostSignificantBits:
- format: int64
- type: integer
- PurchaseAuthResponse:
- description: Response to PurchaseAuthRequest
- type: object
- properties:
- approvalCode:
- description: Code referencing the successful authorization
- type: string
- result:
- description: Result of the request
- enum:
- - OK
- - WRONG
- type: string
diff --git a/design-first-swagger-openliberty/src/main/webapp/META-INF/openapi.yaml b/code-first-openapi-quarkus/src/test/resources/openapi.yaml.txt
similarity index 79%
rename from design-first-swagger-openliberty/src/main/webapp/META-INF/openapi.yaml
rename to code-first-openapi-quarkus/src/test/resources/openapi.yaml.txt
index 878efa3..9a4bd08 100644
--- a/design-first-swagger-openliberty/src/main/webapp/META-INF/openapi.yaml
+++ b/code-first-openapi-quarkus/src/test/resources/openapi.yaml.txt
@@ -1,21 +1,22 @@
-openapi: 3.0.0
+---
+openapi: 3.0.3
info:
- title: txproc-design-first-swagger-openliberty
+ title: txproc-code-first-openapi
version: "0.9"
-servers:
- - url: http://localhost:8080
paths:
/api/txproc/pincheck:
post:
+ tags:
+ - Tx Proc
summary: Check the pin
operationId: pinCheck
requestBody:
description: PIN Check Request Body
- required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PinCheckRequest'
+ required: true
responses:
default:
description: PIN Check Response
@@ -25,15 +26,17 @@ paths:
$ref: '#/components/schemas/PinCheckResponse'
/api/txproc/purchase:
post:
+ tags:
+ - Tx Proc
summary: Authorize a Purchase
operationId: purchase
requestBody:
description: Purchase Request Body
- required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PurchaseAuthRequest'
+ required: true
responses:
default:
description: Purchase Response
@@ -43,31 +46,47 @@ paths:
$ref: '#/components/schemas/PurchaseAuthResponse'
components:
schemas:
+ Code:
+ description: Result of the request
+ enum:
+ - OK
+ - WRONG
+ type: string
+ Code1:
+ description: Result of the request
+ enum:
+ - OK
+ - WRONG
+ type: string
EmvTags:
- description: Collection of EMV tags
title: EmvTags
+ description: Collection of EMV tags
type: object
properties:
- 84:
- description: The EMV AID as reported by ICC
+ "84":
title: Dedicated Filename
+ description: The EMV AID as reported by ICC
type: string
- 9F1A:
+ "9F1A":
description: Terminal Country Code
type: string
Pan:
- description: The number embossed on credit cards
title: PAN (Primary Account Number)
- # type: string would make Swagger-UI prettier, but can't use own type
- type: object
- format: string
+ description: The number embossed on credit cards
+ type: string
PinCheckRequest:
description: Request for checking a PIN
required:
+ - uuid
- pan
- pinBlock
- - uuid
+ type: object
properties:
+ uuid:
+ description: Unique ID of the request
+ type: string
+ allOf:
+ - $ref: '#/components/schemas/UUID'
pan:
$ref: '#/components/schemas/Pan'
pinBlock:
@@ -76,50 +95,42 @@ components:
Fieldcode: C003
type: string
- uuid:
- description: Unique ID of the request
- format: uuid
- type: string
- type: object
PinCheckResponse:
description: Tells if the PIN in the request was correct
+ type: object
properties:
result:
- description: Result of the request
- enum:
- - OK
- - WRONG
- type: string
+ $ref: '#/components/schemas/Code'
tries:
- description: Number of remaining tries
format: int32
+ description: Number of remaining tries
type: integer
- type: object
PurchaseAuthRequest:
description: Request for authorizing a Purchase
required:
- - pan
- uuid
+ - pan
+ type: object
properties:
- emvTags:
- $ref: '#/components/schemas/EmvTags'
- pan:
- $ref: '#/components/schemas/Pan'
uuid:
description: Unique ID of the request
- format: uuid
type: string
- type: object
+ allOf:
+ - $ref: '#/components/schemas/UUID'
+ pan:
+ $ref: '#/components/schemas/Pan'
+ emvTags:
+ $ref: '#/components/schemas/EmvTags'
PurchaseAuthResponse:
description: Response to PurchaseAuthRequest
+ type: object
properties:
+ result:
+ $ref: '#/components/schemas/Code1'
approvalCode:
description: Code referencing the successful authorization
type: string
- result:
- description: Result of the request
- enum:
- - OK
- - WRONG
- type: string
- type: object
+ UUID:
+ format: uuid
+ pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"
+ type: string
diff --git a/code-first-swagger/.editorconfig b/code-first-swagger/.editorconfig
new file mode 100644
index 0000000..222d8e4
--- /dev/null
+++ b/code-first-swagger/.editorconfig
@@ -0,0 +1,19 @@
+# editor configuration containing values that are different from the IntelliJ default
+
+[*]
+charset = utf-8
+indent_size = 4
+indent_style = space
+
+[*.java]
+ij_java_imports_layout = $*, |, java.**, |, jakarta.**, javax.**, |, oracle.**, |, org.**, |, com.**, |, *
+
+[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.rng,*.tld,*.wadl,*.wsdd,*.wsdl,*.xjb,*.xml,*.xsd,*.xsl,*.xslt,*.xul}]
+ij_xml_line_comment_at_first_column = false
+
+[{*.har,*.jsb2,*.jsb3,*.json,*.ndjson,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}]
+indent_size = 2
+
+[{*.yaml,*.yml}]
+indent_size = 2
+ij_yaml_indent_sequence_value = false
diff --git a/code-first-swagger/README.md b/code-first-swagger/README.md
index b0d635d..c04e593 100644
--- a/code-first-swagger/README.md
+++ b/code-first-swagger/README.md
@@ -20,3 +20,7 @@ Once the service runs:
- http://localhost:8080/openapi fetches the OpenAPI document
- http://localhost:8080/swagger-ui shows an interactive view of the API (based on Swagger-UI)
+
+## Swagger Scanner
+
+Plugin source: [swagger-maven-plugin](https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-maven-plugin)
diff --git a/code-first-swagger/pom.xml b/code-first-swagger/pom.xml
index 822ae9c..234bb61 100755
--- a/code-first-swagger/pom.xml
+++ b/code-first-swagger/pom.xml
@@ -14,20 +14,20 @@
- 11
+ 17
- 1.18.10
- 0.25.0
- 2.0.10
+ 1.18.30
+ 3.5.0
+ 2.2.18
2.2
- 2.10.0
+ 3.2.2
- 3.8.1
- 2.22.2
+ 3.11.0
+ 3.2.1
@@ -43,7 +43,7 @@
-
+
io.quarkus
quarkus-resteasy-jsonb
@@ -96,6 +96,13 @@
${json.unit.version}
test
+
+
+
+ io.quarkus
+ quarkus-smallrye-openapi-deployment
+ test
+
@@ -103,7 +110,7 @@
io.swagger.core.v3
- swagger-maven-plugin
+ swagger-maven-plugin-jakarta
${swagger.version}
openapi
@@ -113,6 +120,7 @@
ch.schlau.pesche.apidocs.swagger.codefirst
true
+ true
@@ -142,6 +150,13 @@
${java.release}
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+
+
@@ -149,9 +164,9 @@
maven-surefire-plugin
${maven.surefire.plugin.version}
-
+
org.jboss.logmanager.LogManager
-
+
**/*Test.java
diff --git a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/JaxrsApplication.java b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/JaxrsApplication.java
index 0691e26..80e422f 100644
--- a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/JaxrsApplication.java
+++ b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/JaxrsApplication.java
@@ -1,7 +1,7 @@
package ch.schlau.pesche.apidocs.swagger.codefirst.rest;
-import javax.ws.rs.ApplicationPath;
-import javax.ws.rs.core.Application;
+import jakarta.ws.rs.ApplicationPath;
+import jakarta.ws.rs.core.Application;
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.info.Info;
diff --git a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/JsonConfiguration.java b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/JsonConfiguration.java
index 4464ea8..2d90c36 100644
--- a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/JsonConfiguration.java
+++ b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/JsonConfiguration.java
@@ -1,8 +1,8 @@
package ch.schlau.pesche.apidocs.swagger.codefirst.rest;
-import javax.json.bind.Jsonb;
-import javax.json.bind.JsonbBuilder;
-import javax.json.bind.JsonbConfig;
+import jakarta.json.bind.Jsonb;
+import jakarta.json.bind.JsonbBuilder;
+import jakarta.json.bind.JsonbConfig;
import ch.schlau.pesche.apidocs.swagger.codefirst.txproc.model.PanJsonAdapter;
import lombok.experimental.UtilityClass;
diff --git a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/JsonContextResolver.java b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/JsonContextResolver.java
index 4ab43e5..ab6f55b 100644
--- a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/JsonContextResolver.java
+++ b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/JsonContextResolver.java
@@ -2,9 +2,9 @@
import static ch.schlau.pesche.apidocs.swagger.codefirst.rest.JsonConfiguration.JSONB;
-import javax.json.bind.Jsonb;
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.Provider;
+import jakarta.json.bind.Jsonb;
+import jakarta.ws.rs.ext.ContextResolver;
+import jakarta.ws.rs.ext.Provider;
@Provider
public class JsonContextResolver implements ContextResolver {
diff --git a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/TxProc.java b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/TxProc.java
index 2be4735..01fb72c 100644
--- a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/TxProc.java
+++ b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/TxProc.java
@@ -2,11 +2,11 @@
import java.util.Optional;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
import ch.schlau.pesche.apidocs.swagger.codefirst.txproc.PinCheckRequest;
import ch.schlau.pesche.apidocs.swagger.codefirst.txproc.PinCheckResponse;
@@ -27,7 +27,8 @@ public class TxProc {
@Path("/pincheck")
@POST
- @Operation(summary = "Check the pin")
+ @Operation(summary = "Check the pin",
+ tags = {"Tx Proc"})
@ApiResponse(description = "PIN Check Response",
content = @Content(schema = @Schema(implementation = PinCheckResponse.class)))
public PinCheckResponse pinCheck(
@@ -48,7 +49,8 @@ public PinCheckResponse pinCheck(
@Path("/purchase")
@POST
- @Operation(summary = "Authorize a Purchase")
+ @Operation(summary = "Authorize a Purchase",
+ tags = {"Tx Proc"})
@ApiResponse(description = "Purchase Response",
content = @Content(schema = @Schema(implementation = PurchaseAuthResponse.class)))
public PurchaseAuthResponse purchase(
diff --git a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/PinCheckRequest.java b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/PinCheckRequest.java
index 2355629..e6c35e4 100644
--- a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/PinCheckRequest.java
+++ b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/PinCheckRequest.java
@@ -2,24 +2,28 @@
import java.util.UUID;
+import jakarta.validation.constraints.NotNull;
+
import ch.schlau.pesche.apidocs.swagger.codefirst.txproc.doc.Model;
import ch.schlau.pesche.apidocs.swagger.codefirst.txproc.model.Pan;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
-@Schema(description = "Request for checking a PIN",
- requiredProperties = {"uuid", "pan", "pinBlock"})
+@Schema(description = "Request for checking a PIN")
@Getter
@Setter
public class PinCheckRequest {
- @Schema(type = "string", description = Model.UUID)
+ @Schema(description = Model.UUID)
+ @NotNull
private UUID uuid;
// the class Pan already carries a @Schema annotation
+ @NotNull
private Pan pan;
@Schema(description = Model.PIN_BLOCK)
+ @NotNull
private String pinBlock;
}
diff --git a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/PurchaseAuthRequest.java b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/PurchaseAuthRequest.java
index ca8f53c..6705a6b 100644
--- a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/PurchaseAuthRequest.java
+++ b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/PurchaseAuthRequest.java
@@ -2,6 +2,8 @@
import java.util.UUID;
+import jakarta.validation.constraints.NotNull;
+
import ch.schlau.pesche.apidocs.swagger.codefirst.txproc.doc.Model;
import ch.schlau.pesche.apidocs.swagger.codefirst.txproc.model.EmvTags;
import ch.schlau.pesche.apidocs.swagger.codefirst.txproc.model.Pan;
@@ -9,16 +11,17 @@
import lombok.Getter;
import lombok.Setter;
-@Schema(description = "Request for authorizing a Purchase",
- requiredProperties = {"uuid", "pan"})
+@Schema(description = "Request for authorizing a Purchase")
@Getter
@Setter
public class PurchaseAuthRequest {
- @Schema(type = "string", description = Model.UUID)
+ @Schema(description = Model.UUID)
+ @NotNull
private UUID uuid;
// the class Pan already carries a @Schema annotation
+ @NotNull
private Pan pan;
// the class EmvTags already carries a @Schema annotation
diff --git a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/PurchaseAuthResponse.java b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/PurchaseAuthResponse.java
index 662be71..702b190 100644
--- a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/PurchaseAuthResponse.java
+++ b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/PurchaseAuthResponse.java
@@ -9,12 +9,13 @@
@Setter
public class PurchaseAuthResponse {
+ @Schema(description = "Result of the request")
public enum Code {
OK,
WRONG
}
- @Schema(description = "Result of the request")
+ // the enum Code already carries a @Schema annotation
private Code result;
@Schema(description = "Code referencing the successful authorization")
diff --git a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/doc/Model.java b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/doc/Model.java
index ebb40a4..b2e60f5 100644
--- a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/doc/Model.java
+++ b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/doc/Model.java
@@ -11,7 +11,9 @@ public class Model {
public static final String UUID = "Unique ID of the request";
- public static final String PIN_BLOCK = "Encrypted binary data containing a PIN"
- + "\n\nFieldcode: C003";
+ public static final String PIN_BLOCK = """
+ Encrypted binary data containing a PIN
+
+ Fieldcode: C003""";
}
diff --git a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/EmvTags.java b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/EmvTags.java
index 8dc37f8..5b78e29 100644
--- a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/EmvTags.java
+++ b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/EmvTags.java
@@ -1,6 +1,6 @@
package ch.schlau.pesche.apidocs.swagger.codefirst.txproc.model;
-import javax.json.bind.annotation.JsonbProperty;
+import jakarta.json.bind.annotation.JsonbProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
diff --git a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/Pan.java b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/Pan.java
index 22fdba9..2d90e58 100644
--- a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/Pan.java
+++ b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/Pan.java
@@ -1,6 +1,6 @@
package ch.schlau.pesche.apidocs.swagger.codefirst.txproc.model;
-import javax.validation.constraints.Pattern;
+import jakarta.validation.constraints.Pattern;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
diff --git a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/PanJsonAdapter.java b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/PanJsonAdapter.java
index 8be41cc..2931ecb 100644
--- a/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/PanJsonAdapter.java
+++ b/code-first-swagger/src/main/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/PanJsonAdapter.java
@@ -1,6 +1,6 @@
package ch.schlau.pesche.apidocs.swagger.codefirst.txproc.model;
-import javax.json.bind.adapter.JsonbAdapter;
+import jakarta.json.bind.adapter.JsonbAdapter;
public class PanJsonAdapter implements JsonbAdapter {
@Override
diff --git a/code-first-swagger/src/main/resources/META-INF/microprofile-config.properties b/code-first-swagger/src/main/resources/META-INF/microprofile-config.properties
index 8d22654..fcf1484 100644
--- a/code-first-swagger/src/main/resources/META-INF/microprofile-config.properties
+++ b/code-first-swagger/src/main/resources/META-INF/microprofile-config.properties
@@ -1,6 +1,10 @@
# the OpenAPI document is generated by the Swagger Maven Plugin, no annotation scan needed
mp.openapi.scan.disable = true
+# keep /openapi instead /q/openapi for the time being
+# see https://quarkus.io/blog/path-resolution-in-quarkus/
+quarkus.http.non-application-root-path=${quarkus.http.root-path}
+
quarkus.log.level = DEBUG
quarkus.log.console.level = INFO
quarkus.log.file.enable = true
diff --git a/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/OpenapiDocumentIT.java b/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/OpenapiDocumentIT.java
index 451ed7a..499ea50 100644
--- a/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/OpenapiDocumentIT.java
+++ b/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/OpenapiDocumentIT.java
@@ -11,7 +11,7 @@
import java.io.IOException;
import java.nio.charset.StandardCharsets;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MediaType;
import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.Test;
@@ -44,8 +44,8 @@ static class OpenapiSkeleton {
@Test
void openapi_yaml() throws IOException {
- String expected = loadResourceFile("openapi.yaml");
- String expectedSorted = loadResourceFile("openapi-sorted.yaml");
+ String expected = loadResourceFile("openapi.yaml.txt");
+ String expectedSorted = loadResourceFile("openapi-sorted.yaml.txt");
String document = when().get("/openapi")
.then()
@@ -55,8 +55,7 @@ void openapi_yaml() throws IOException {
String yamlSorted = sortYaml(document);
assertAll("openapi yaml"
- // the unsorted document generated by Swagger has no deterministic order
- // , () -> assertThat("unsorted", document, is(expected))
+ , () -> assertThat("unsorted", document, is(expected))
, () -> assertThat("sorted", yamlSorted, is(expectedSorted))
);
}
@@ -64,7 +63,7 @@ void openapi_yaml() throws IOException {
@Test
void openapi_json() throws IOException {
- String expected = loadResourceFile("openapi.json");
+ String expected = loadResourceFile("openapi.json.txt");
String document = given().accept(MediaType.APPLICATION_JSON)
.when().get("/openapi")
@@ -73,7 +72,7 @@ void openapi_json() throws IOException {
.assertThat().contentType(MediaType.APPLICATION_JSON)
.extract().response().asString();
- assertThat(document, jsonEquals(expected));
+ assertThat("actual: " + document, document, jsonEquals(expected));
}
private String sortYaml(String yaml) throws IOException {
diff --git a/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/TxProcPincheckIT.java b/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/TxProcPincheckIT.java
index 63110f7..f76e9eb 100644
--- a/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/TxProcPincheckIT.java
+++ b/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/TxProcPincheckIT.java
@@ -3,7 +3,7 @@
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MediaType;
import org.junit.jupiter.api.Test;
diff --git a/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/TxProcPurchaseIT.java b/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/TxProcPurchaseIT.java
index f869971..12b4620 100644
--- a/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/TxProcPurchaseIT.java
+++ b/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/rest/TxProcPurchaseIT.java
@@ -3,7 +3,7 @@
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MediaType;
import org.junit.jupiter.api.Test;
diff --git a/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/EmvTagsTest.java b/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/EmvTagsTest.java
index cd61cf8..54ae16a 100644
--- a/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/EmvTagsTest.java
+++ b/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/EmvTagsTest.java
@@ -4,7 +4,7 @@
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
-import javax.json.bind.Jsonb;
+import jakarta.json.bind.Jsonb;
import org.junit.jupiter.api.Test;
diff --git a/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/PanTest.java b/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/PanTest.java
index 17ed1be..03aab1a 100644
--- a/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/PanTest.java
+++ b/code-first-swagger/src/test/java/ch/schlau/pesche/apidocs/swagger/codefirst/txproc/model/PanTest.java
@@ -5,7 +5,7 @@
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
-import javax.json.bind.Jsonb;
+import jakarta.json.bind.Jsonb;
import org.junit.jupiter.api.Test;
diff --git a/code-first-swagger/src/test/resources/openapi-sorted.yaml b/code-first-swagger/src/test/resources/openapi-sorted.yaml
deleted file mode 100644
index c142e57..0000000
--- a/code-first-swagger/src/test/resources/openapi-sorted.yaml
+++ /dev/null
@@ -1,120 +0,0 @@
----
-openapi: 3.0.1
-info:
- title: txproc-code-first-swagger
- version: 0.9
-paths:
- /txproc/pincheck:
- post:
- operationId: pinCheck
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PinCheckRequest'
- description: PIN Check Request Body
- required: true
- responses:
- default:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PinCheckResponse'
- description: PIN Check Response
- summary: Check the pin
- /txproc/purchase:
- post:
- operationId: purchase
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PurchaseAuthRequest'
- description: Purchase Request Body
- required: true
- responses:
- default:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PurchaseAuthResponse'
- description: Purchase Response
- summary: Authorize a Purchase
-components:
- schemas:
- EmvTags:
- description: Collection of EMV tags
- properties:
- 84:
- description: The EMV AID as reported by ICC
- title: Dedicated Filename
- type: string
- 9F1A:
- description: Terminal Country Code
- type: string
- title: EmvTags
- type: object
- PinCheckRequest:
- description: Request for checking a PIN
- properties:
- pan:
- description: The number embossed on credit cards
- title: PAN (Primary Account Number)
- type: string
- pinBlock:
- description: |-
- Encrypted binary data containing a PIN
-
- Fieldcode: C003
- type: string
- uuid:
- description: Unique ID of the request
- type: string
- required:
- - pan
- - pinBlock
- - uuid
- type: object
- PinCheckResponse:
- description: Tells if the PIN in the request was correct
- properties:
- result:
- description: Result of the request
- enum:
- - OK
- - WRONG
- type: string
- tries:
- description: Number of remaining tries
- format: int32
- type: integer
- type: object
- PurchaseAuthRequest:
- description: Request for authorizing a Purchase
- properties:
- emvTags:
- $ref: '#/components/schemas/EmvTags'
- pan:
- description: The number embossed on credit cards
- title: PAN (Primary Account Number)
- type: string
- uuid:
- description: Unique ID of the request
- type: string
- required:
- - pan
- - uuid
- type: object
- PurchaseAuthResponse:
- description: Response to PurchaseAuthRequest
- properties:
- approvalCode:
- description: Code referencing the successful authorization
- type: string
- result:
- description: Result of the request
- enum:
- - OK
- - WRONG
- type: string
- type: object
diff --git a/code-first-openapi-openliberty/src/test/resources/openapi-sorted.yaml b/code-first-swagger/src/test/resources/openapi-sorted.yaml.txt
similarity index 96%
rename from code-first-openapi-openliberty/src/test/resources/openapi-sorted.yaml
rename to code-first-swagger/src/test/resources/openapi-sorted.yaml.txt
index accdce7..e1d91c2 100644
--- a/code-first-openapi-openliberty/src/test/resources/openapi-sorted.yaml
+++ b/code-first-swagger/src/test/resources/openapi-sorted.yaml.txt
@@ -1,10 +1,8 @@
---
-openapi: 3.0.0
+openapi: 3.0.3
info:
- title: txproc-code-first-openapi
+ title: txproc-code-first-swagger
version: 0.9
-servers:
-- url: http://localhost:8080
paths:
/api/txproc/pincheck:
post:
@@ -24,6 +22,8 @@ paths:
$ref: '#/components/schemas/PinCheckResponse'
description: PIN Check Response
summary: Check the pin
+ tags:
+ - Tx Proc
/api/txproc/purchase:
post:
operationId: purchase
@@ -42,6 +42,8 @@ paths:
$ref: '#/components/schemas/PurchaseAuthResponse'
description: Purchase Response
summary: Authorize a Purchase
+ tags:
+ - Tx Proc
components:
schemas:
EmvTags:
@@ -89,6 +91,7 @@ components:
type: string
tries:
description: Number of remaining tries
+ format: int32
type: integer
type: object
PurchaseAuthRequest:
diff --git a/code-first-swagger/src/test/resources/openapi.json b/code-first-swagger/src/test/resources/openapi.json
deleted file mode 100644
index 9234350..0000000
--- a/code-first-swagger/src/test/resources/openapi.json
+++ /dev/null
@@ -1,170 +0,0 @@
-{
- "openapi": "3.0.1",
- "info": {
- "title": "txproc-code-first-swagger",
- "version": "0.9"
- },
- "paths": {
- "/txproc/pincheck": {
- "post": {
- "summary": "Check the pin",
- "operationId": "pinCheck",
- "requestBody": {
- "description": "PIN Check Request Body",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PinCheckRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "default": {
- "description": "PIN Check Response",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PinCheckResponse"
- }
- }
- }
- }
- }
- }
- },
- "/txproc/purchase": {
- "post": {
- "summary": "Authorize a Purchase",
- "operationId": "purchase",
- "requestBody": {
- "description": "Purchase Request Body",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PurchaseAuthRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "default": {
- "description": "Purchase Response",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PurchaseAuthResponse"
- }
- }
- }
- }
- }
- }
- }
- },
- "components": {
- "schemas": {
- "PinCheckResponse": {
- "description": "Tells if the PIN in the request was correct",
- "type": "object",
- "properties": {
- "result": {
- "description": "Result of the request",
- "enum": [
- "OK",
- "WRONG"
- ],
- "type": "string"
- },
- "tries": {
- "format": "int32",
- "description": "Number of remaining tries",
- "type": "integer"
- }
- }
- },
- "PinCheckRequest": {
- "description": "Request for checking a PIN",
- "required": [
- "pan",
- "pinBlock",
- "uuid"
- ],
- "type": "object",
- "properties": {
- "uuid": {
- "description": "Unique ID of the request",
- "type": "string"
- },
- "pan": {
- "title": "PAN (Primary Account Number)",
- "description": "The number embossed on credit cards",
- "type": "string"
- },
- "pinBlock": {
- "description": "Encrypted binary data containing a PIN\n\nFieldcode: C003",
- "type": "string"
- }
- }
- },
- "PurchaseAuthResponse": {
- "description": "Response to PurchaseAuthRequest",
- "type": "object",
- "properties": {
- "result": {
- "description": "Result of the request",
- "enum": [
- "OK",
- "WRONG"
- ],
- "type": "string"
- },
- "approvalCode": {
- "description": "Code referencing the successful authorization",
- "type": "string"
- }
- }
- },
- "EmvTags": {
- "title": "EmvTags",
- "description": "Collection of EMV tags",
- "type": "object",
- "properties": {
- "84": {
- "title": "Dedicated Filename",
- "description": "The EMV AID as reported by ICC",
- "type": "string"
- },
- "9F1A": {
- "description": "Terminal Country Code",
- "type": "string"
- }
- }
- },
- "PurchaseAuthRequest": {
- "description": "Request for authorizing a Purchase",
- "required": [
- "pan",
- "uuid"
- ],
- "type": "object",
- "properties": {
- "uuid": {
- "description": "Unique ID of the request",
- "type": "string"
- },
- "pan": {
- "title": "PAN (Primary Account Number)",
- "description": "The number embossed on credit cards",
- "type": "string"
- },
- "emvTags": {
- "$ref": "#/components/schemas/EmvTags"
- }
- }
- }
- }
- }
-}
diff --git a/code-first-swagger/src/test/resources/openapi.json.txt b/code-first-swagger/src/test/resources/openapi.json.txt
new file mode 100644
index 0000000..d290446
--- /dev/null
+++ b/code-first-swagger/src/test/resources/openapi.json.txt
@@ -0,0 +1,161 @@
+{
+ "openapi" : "3.0.3",
+ "info" : {
+ "title" : "txproc-code-first-swagger",
+ "version" : "0.9"
+ },
+ "paths" : {
+ "/api/txproc/pincheck" : {
+ "post" : {
+ "tags" : [ "Tx Proc" ],
+ "summary" : "Check the pin",
+ "operationId" : "pinCheck",
+ "requestBody" : {
+ "description" : "PIN Check Request Body",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PinCheckRequest"
+ }
+ }
+ },
+ "required" : true
+ },
+ "responses" : {
+ "default" : {
+ "description" : "PIN Check Response",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PinCheckResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/txproc/purchase" : {
+ "post" : {
+ "tags" : [ "Tx Proc" ],
+ "summary" : "Authorize a Purchase",
+ "operationId" : "purchase",
+ "requestBody" : {
+ "description" : "Purchase Request Body",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PurchaseAuthRequest"
+ }
+ }
+ },
+ "required" : true
+ },
+ "responses" : {
+ "default" : {
+ "description" : "Purchase Response",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PurchaseAuthResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components" : {
+ "schemas" : {
+ "PinCheckResponse" : {
+ "description" : "Tells if the PIN in the request was correct",
+ "type" : "object",
+ "properties" : {
+ "result" : {
+ "description" : "Result of the request",
+ "enum" : [ "OK", "WRONG" ],
+ "type" : "string"
+ },
+ "tries" : {
+ "format" : "int32",
+ "description" : "Number of remaining tries",
+ "type" : "integer"
+ }
+ }
+ },
+ "PinCheckRequest" : {
+ "description" : "Request for checking a PIN",
+ "required" : [ "pan", "pinBlock", "uuid" ],
+ "type" : "object",
+ "properties" : {
+ "uuid" : {
+ "format" : "uuid",
+ "description" : "Unique ID of the request",
+ "type" : "string"
+ },
+ "pan" : {
+ "title" : "PAN (Primary Account Number)",
+ "description" : "The number embossed on credit cards",
+ "type" : "string"
+ },
+ "pinBlock" : {
+ "description" : "Encrypted binary data containing a PIN\n\nFieldcode: C003",
+ "type" : "string"
+ }
+ }
+ },
+ "PurchaseAuthResponse" : {
+ "description" : "Response to PurchaseAuthRequest",
+ "type" : "object",
+ "properties" : {
+ "result" : {
+ "description" : "Result of the request",
+ "enum" : [ "OK", "WRONG" ],
+ "type" : "string"
+ },
+ "approvalCode" : {
+ "description" : "Code referencing the successful authorization",
+ "type" : "string"
+ }
+ }
+ },
+ "EmvTags" : {
+ "title" : "EmvTags",
+ "description" : "Collection of EMV tags",
+ "type" : "object",
+ "properties" : {
+ "84" : {
+ "title" : "Dedicated Filename",
+ "description" : "The EMV AID as reported by ICC",
+ "type" : "string"
+ },
+ "9F1A" : {
+ "description" : "Terminal Country Code",
+ "type" : "string"
+ }
+ }
+ },
+ "PurchaseAuthRequest" : {
+ "description" : "Request for authorizing a Purchase",
+ "required" : [ "pan", "uuid" ],
+ "type" : "object",
+ "properties" : {
+ "uuid" : {
+ "format" : "uuid",
+ "description" : "Unique ID of the request",
+ "type" : "string"
+ },
+ "pan" : {
+ "title" : "PAN (Primary Account Number)",
+ "description" : "The number embossed on credit cards",
+ "type" : "string"
+ },
+ "emvTags" : {
+ "$ref" : "#/components/schemas/EmvTags"
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/code-first-swagger/src/test/resources/openapi.yaml b/code-first-swagger/src/test/resources/openapi.yaml
deleted file mode 100644
index 909ee58..0000000
--- a/code-first-swagger/src/test/resources/openapi.yaml
+++ /dev/null
@@ -1,120 +0,0 @@
----
-openapi: 3.0.1
-info:
- title: txproc-code-first-swagger
- version: "0.9"
-paths:
- /txproc/pincheck:
- post:
- summary: Check the pin
- operationId: pinCheck
- requestBody:
- description: PIN Check Request Body
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PinCheckRequest'
- required: true
- responses:
- default:
- description: PIN Check Response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PinCheckResponse'
- /txproc/purchase:
- post:
- summary: Authorize a Purchase
- operationId: purchase
- requestBody:
- description: Purchase Request Body
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PurchaseAuthRequest'
- required: true
- responses:
- default:
- description: Purchase Response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PurchaseAuthResponse'
-components:
- schemas:
- PinCheckResponse:
- description: Tells if the PIN in the request was correct
- type: object
- properties:
- result:
- description: Result of the request
- enum:
- - OK
- - WRONG
- type: string
- tries:
- format: int32
- description: Number of remaining tries
- type: integer
- PinCheckRequest:
- description: Request for checking a PIN
- required:
- - pan
- - pinBlock
- - uuid
- type: object
- properties:
- uuid:
- description: Unique ID of the request
- type: string
- pan:
- title: PAN (Primary Account Number)
- description: The number embossed on credit cards
- type: string
- pinBlock:
- description: |-
- Encrypted binary data containing a PIN
-
- Fieldcode: C003
- type: string
- PurchaseAuthResponse:
- description: Response to PurchaseAuthRequest
- type: object
- properties:
- result:
- description: Result of the request
- enum:
- - OK
- - WRONG
- type: string
- approvalCode:
- description: Code referencing the successful authorization
- type: string
- EmvTags:
- title: EmvTags
- description: Collection of EMV tags
- type: object
- properties:
- 84:
- title: Dedicated Filename
- description: The EMV AID as reported by ICC
- type: string
- 9F1A:
- description: Terminal Country Code
- type: string
- PurchaseAuthRequest:
- description: Request for authorizing a Purchase
- required:
- - pan
- - uuid
- type: object
- properties:
- uuid:
- description: Unique ID of the request
- type: string
- pan:
- title: PAN (Primary Account Number)
- description: The number embossed on credit cards
- type: string
- emvTags:
- $ref: '#/components/schemas/EmvTags'
diff --git a/code-first-openapi-openliberty/src/test/resources/openapi.yaml b/code-first-swagger/src/test/resources/openapi.yaml.txt
similarity index 94%
rename from code-first-openapi-openliberty/src/test/resources/openapi.yaml
rename to code-first-swagger/src/test/resources/openapi.yaml.txt
index 00f3fd0..f1e2b25 100644
--- a/code-first-openapi-openliberty/src/test/resources/openapi.yaml
+++ b/code-first-swagger/src/test/resources/openapi.yaml.txt
@@ -1,12 +1,13 @@
-openapi: 3.0.0
+---
+openapi: 3.0.3
info:
- title: txproc-code-first-openapi
+ title: txproc-code-first-swagger
version: "0.9"
-servers:
-- url: http://localhost:8080
paths:
/api/txproc/pincheck:
post:
+ tags:
+ - Tx Proc
summary: Check the pin
operationId: pinCheck
requestBody:
@@ -25,6 +26,8 @@ paths:
$ref: '#/components/schemas/PinCheckResponse'
/api/txproc/purchase:
post:
+ tags:
+ - Tx Proc
summary: Authorize a Purchase
operationId: purchase
requestBody:
@@ -43,80 +46,81 @@ paths:
$ref: '#/components/schemas/PurchaseAuthResponse'
components:
schemas:
- PurchaseAuthResponse:
+ PinCheckResponse:
+ description: Tells if the PIN in the request was correct
type: object
properties:
result:
- type: string
description: Result of the request
enum:
- OK
- WRONG
- approvalCode:
type: string
- description: Code referencing the successful authorization
- description: Response to PurchaseAuthRequest
- EmvTags:
- title: EmvTags
+ tries:
+ format: int32
+ description: Number of remaining tries
+ type: integer
+ PinCheckRequest:
+ description: Request for checking a PIN
+ required:
+ - pan
+ - pinBlock
+ - uuid
type: object
properties:
- 84:
- title: Dedicated Filename
+ uuid:
+ format: uuid
+ description: Unique ID of the request
type: string
- description: The EMV AID as reported by ICC
- 9F1A:
+ pan:
+ title: PAN (Primary Account Number)
+ description: The number embossed on credit cards
type: string
- description: Terminal Country Code
- description: Collection of EMV tags
- PinCheckResponse:
+ pinBlock:
+ description: |-
+ Encrypted binary data containing a PIN
+
+ Fieldcode: C003
+ type: string
+ PurchaseAuthResponse:
+ description: Response to PurchaseAuthRequest
type: object
properties:
result:
- type: string
description: Result of the request
enum:
- OK
- WRONG
- tries:
- type: integer
- description: Number of remaining tries
- description: Tells if the PIN in the request was correct
- PurchaseAuthRequest:
- required:
- - pan
- - uuid
+ type: string
+ approvalCode:
+ description: Code referencing the successful authorization
+ type: string
+ EmvTags:
+ title: EmvTags
+ description: Collection of EMV tags
type: object
properties:
- uuid:
+ "84":
+ title: Dedicated Filename
+ description: The EMV AID as reported by ICC
type: string
- description: Unique ID of the request
- format: uuid
- pan:
- title: PAN (Primary Account Number)
+ "9F1A":
+ description: Terminal Country Code
type: string
- description: The number embossed on credit cards
- emvTags:
- $ref: '#/components/schemas/EmvTags'
+ PurchaseAuthRequest:
description: Request for authorizing a Purchase
- PinCheckRequest:
required:
- pan
- - pinBlock
- uuid
type: object
properties:
uuid:
- type: string
- description: Unique ID of the request
format: uuid
+ description: Unique ID of the request
+ type: string
pan:
title: PAN (Primary Account Number)
- type: string
description: The number embossed on credit cards
- pinBlock:
type: string
- description: |-
- Encrypted binary data containing a PIN
-
- Fieldcode: C003
- description: Request for checking a PIN
+ emvTags:
+ $ref: '#/components/schemas/EmvTags'
diff --git a/design-first-openapi-generator/.editorconfig b/design-first-openapi-generator/.editorconfig
new file mode 100644
index 0000000..222d8e4
--- /dev/null
+++ b/design-first-openapi-generator/.editorconfig
@@ -0,0 +1,19 @@
+# editor configuration containing values that are different from the IntelliJ default
+
+[*]
+charset = utf-8
+indent_size = 4
+indent_style = space
+
+[*.java]
+ij_java_imports_layout = $*, |, java.**, |, jakarta.**, javax.**, |, oracle.**, |, org.**, |, com.**, |, *
+
+[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.rng,*.tld,*.wadl,*.wsdd,*.wsdl,*.xjb,*.xml,*.xsd,*.xsl,*.xslt,*.xul}]
+ij_xml_line_comment_at_first_column = false
+
+[{*.har,*.jsb2,*.jsb3,*.json,*.ndjson,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}]
+indent_size = 2
+
+[{*.yaml,*.yml}]
+indent_size = 2
+ij_yaml_indent_sequence_value = false
diff --git a/design-first-openapi-generator/pom.xml b/design-first-openapi-generator/pom.xml
index 6950ae4..8d11afb 100644
--- a/design-first-openapi-generator/pom.xml
+++ b/design-first-openapi-generator/pom.xml
@@ -14,23 +14,21 @@
- 11
+ 17
-
- 2.9.9.3
- 1.18.10
- 0.25.0
- 1.5.22
- 4.1.3
+ 1.18.30
+ 3.5.0
+ 1.6.12
+ 7.0.1
2.2
- 2.10.0
+ 3.2.2
- 3.8.1
- 2.22.2
+ 3.11.0
+ 3.2.1
${project.build.directory}/generated-sources/openapi
@@ -48,7 +46,7 @@
-
+
io.quarkus
quarkus-resteasy-jsonb
@@ -59,18 +57,9 @@
+
- com.google.code.findbugs
- jsr305
- 3.0.2
-
-
- com.fasterxml.jackson.core
- jackson-databind
- ${jackson-2-version}
- provided
-
-
+
io.swagger
swagger-annotations
@@ -115,6 +104,13 @@
${json.unit.version}
test
+
+
+
+ io.quarkus
+ quarkus-smallrye-openapi-deployment
+ test
+
@@ -122,7 +118,7 @@
org.openapitools
openapi-generator-maven-plugin
- ${openapi.generator.version}
+ ${openapi-generator.plugin.version}
@@ -142,17 +138,19 @@
true
java8
native
+ true
false
.
ch.schlau.pesche.apidocs.openapi.designfirst.generated.model
-
- hideGenerationTimestamp=true
+
+ hideGenerationTimestamp=true
+ supportUrlQuery=false
-
- Pan=ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model.Pan
-
+
+ Pan=ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model.Pan
+
@@ -176,6 +174,13 @@
${java.release}
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+
+
@@ -183,10 +188,10 @@
maven-surefire-plugin
${maven.surefire.plugin.version}
-
+
org.jboss.logmanager.LogManager
${generated.path}
-
+
**/*Test.java
diff --git a/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/JaxrsApplication.java b/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/JaxrsApplication.java
index 4e66bf3..23ce81a 100644
--- a/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/JaxrsApplication.java
+++ b/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/JaxrsApplication.java
@@ -1,7 +1,7 @@
package ch.schlau.pesche.apidocs.openapi.designfirst.rest;
-import javax.ws.rs.ApplicationPath;
-import javax.ws.rs.core.Application;
+import jakarta.ws.rs.ApplicationPath;
+import jakarta.ws.rs.core.Application;
@ApplicationPath("/api")
public class JaxrsApplication extends Application {
diff --git a/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/JsonConfiguration.java b/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/JsonConfiguration.java
index 8ab3b4d..8aa2379 100644
--- a/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/JsonConfiguration.java
+++ b/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/JsonConfiguration.java
@@ -1,8 +1,8 @@
package ch.schlau.pesche.apidocs.openapi.designfirst.rest;
-import javax.json.bind.Jsonb;
-import javax.json.bind.JsonbBuilder;
-import javax.json.bind.JsonbConfig;
+import jakarta.json.bind.Jsonb;
+import jakarta.json.bind.JsonbBuilder;
+import jakarta.json.bind.JsonbConfig;
import ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model.PanJsonAdapter;
import lombok.experimental.UtilityClass;
diff --git a/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/JsonContextResolver.java b/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/JsonContextResolver.java
index 79cc3ba..6539144 100644
--- a/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/JsonContextResolver.java
+++ b/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/JsonContextResolver.java
@@ -2,9 +2,9 @@
import static ch.schlau.pesche.apidocs.openapi.designfirst.rest.JsonConfiguration.JSONB;
-import javax.json.bind.Jsonb;
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.Provider;
+import jakarta.json.bind.Jsonb;
+import jakarta.ws.rs.ext.ContextResolver;
+import jakarta.ws.rs.ext.Provider;
@Provider
public class JsonContextResolver implements ContextResolver {
diff --git a/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/TxProc.java b/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/TxProc.java
index 94f97f3..b09cb82 100644
--- a/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/TxProc.java
+++ b/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/TxProc.java
@@ -2,17 +2,18 @@
import java.util.Optional;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
import ch.schlau.pesche.apidocs.openapi.designfirst.generated.model.EmvTags;
import ch.schlau.pesche.apidocs.openapi.designfirst.generated.model.PinCheckRequest;
import ch.schlau.pesche.apidocs.openapi.designfirst.generated.model.PinCheckResponse;
import ch.schlau.pesche.apidocs.openapi.designfirst.generated.model.PurchaseAuthRequest;
import ch.schlau.pesche.apidocs.openapi.designfirst.generated.model.PurchaseAuthResponse;
+import ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model.Pan;
@Path("/txproc")
@Consumes(MediaType.APPLICATION_JSON)
@@ -38,7 +39,8 @@ public PinCheckResponse pinCheck(PinCheckRequest request) {
public PurchaseAuthResponse purchase(PurchaseAuthRequest request) {
PurchaseAuthResponse response = new PurchaseAuthResponse();
- if (Optional.ofNullable((String) request.getPan())
+ if (Optional.ofNullable(request.getPan())
+ .map(Pan::getPan)
.filter(s -> s.startsWith("42"))
.isPresent()) {
response.setResult(PurchaseAuthResponse.ResultEnum.OK);
diff --git a/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/txproc/model/Pan.java b/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/txproc/model/Pan.java
index f57d7c7..4874670 100644
--- a/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/txproc/model/Pan.java
+++ b/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/txproc/model/Pan.java
@@ -1,6 +1,6 @@
package ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model;
-import javax.validation.constraints.Pattern;
+import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Getter;
diff --git a/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/txproc/model/PanJsonAdapter.java b/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/txproc/model/PanJsonAdapter.java
index 0bce2ab..828954a 100644
--- a/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/txproc/model/PanJsonAdapter.java
+++ b/design-first-openapi-generator/src/main/java/ch/schlau/pesche/apidocs/openapi/designfirst/txproc/model/PanJsonAdapter.java
@@ -1,6 +1,6 @@
package ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model;
-import javax.json.bind.adapter.JsonbAdapter;
+import jakarta.json.bind.adapter.JsonbAdapter;
public class PanJsonAdapter implements JsonbAdapter {
@Override
diff --git a/design-first-openapi-generator/src/main/resources/META-INF/microprofile-config.properties b/design-first-openapi-generator/src/main/resources/META-INF/microprofile-config.properties
index ac79149..fbdbd0a 100644
--- a/design-first-openapi-generator/src/main/resources/META-INF/microprofile-config.properties
+++ b/design-first-openapi-generator/src/main/resources/META-INF/microprofile-config.properties
@@ -1,2 +1,6 @@
# the OpenAPI document is provided as source (design-first), no annotation scan needed
mp.openapi.scan.disable = true
+
+# keep /openapi instead /q/openapi for the time being
+# see https://quarkus.io/blog/path-resolution-in-quarkus/
+quarkus.http.non-application-root-path=${quarkus.http.root-path}
diff --git a/design-first-openapi-generator/src/main/resources/META-INF/openapi.yaml b/design-first-openapi-generator/src/main/resources/META-INF/openapi.yaml
index f83cc5f..1fa06f6 100644
--- a/design-first-openapi-generator/src/main/resources/META-INF/openapi.yaml
+++ b/design-first-openapi-generator/src/main/resources/META-INF/openapi.yaml
@@ -1,9 +1,9 @@
-openapi: 3.0.0
+openapi: 3.0.3
info:
title: txproc-design-first-openapi
version: "0.9"
servers:
- - url: http://localhost:8080
+- url: http://localhost:8080
paths:
/api/txproc/pincheck:
post:
diff --git a/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/OpenapiDocumentIT.java b/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/OpenapiDocumentIT.java
index fb14de6..00fb605 100644
--- a/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/OpenapiDocumentIT.java
+++ b/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/OpenapiDocumentIT.java
@@ -11,7 +11,7 @@
import java.io.IOException;
import java.nio.charset.StandardCharsets;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MediaType;
import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.Test;
@@ -44,8 +44,8 @@ static class OpenapiSkeleton {
@Test
void openapi_yaml() throws IOException {
- String expected = loadResourceFile("openapi.yaml");
- String expectedSorted = loadResourceFile("openapi-sorted.yaml");
+ String expected = loadResourceFile("openapi.yaml.txt");
+ String expectedSorted = loadResourceFile("openapi-sorted.yaml.txt");
String document = when().get("/openapi")
.then()
@@ -63,7 +63,7 @@ void openapi_yaml() throws IOException {
@Test
void openapi_json() throws IOException {
- String expected = loadResourceFile("openapi.json");
+ String expected = loadResourceFile("openapi.json.txt");
String document = given().accept(MediaType.APPLICATION_JSON)
.when().get("/openapi")
@@ -72,7 +72,7 @@ void openapi_json() throws IOException {
.assertThat().contentType(MediaType.APPLICATION_JSON)
.extract().response().asString();
- assertThat(document, jsonEquals(expected));
+ assertThat("actual: " + document, document, jsonEquals(expected));
}
private String sortYaml(String yaml) throws IOException {
diff --git a/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/TxProcPincheckIT.java b/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/TxProcPincheckIT.java
index 221a8f7..c501135 100644
--- a/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/TxProcPincheckIT.java
+++ b/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/TxProcPincheckIT.java
@@ -3,7 +3,7 @@
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MediaType;
import org.junit.jupiter.api.Test;
diff --git a/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/TxProcPurchaseIT.java b/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/TxProcPurchaseIT.java
index acc9b4f..9d1d950 100644
--- a/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/TxProcPurchaseIT.java
+++ b/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/rest/TxProcPurchaseIT.java
@@ -3,7 +3,7 @@
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MediaType;
import org.junit.jupiter.api.Test;
diff --git a/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/txproc/model/PanTest.java b/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/txproc/model/PanTest.java
index 5e28152..21b88de 100644
--- a/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/txproc/model/PanTest.java
+++ b/design-first-openapi-generator/src/test/java/ch/schlau/pesche/apidocs/openapi/designfirst/txproc/model/PanTest.java
@@ -5,7 +5,7 @@
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
-import javax.json.bind.Jsonb;
+import jakarta.json.bind.Jsonb;
import org.junit.jupiter.api.Test;
diff --git a/design-first-openapi-generator/src/test/resources/EmvTags.java.txt b/design-first-openapi-generator/src/test/resources/EmvTags.java.txt
index 9c5231f..67b962c 100644
--- a/design-first-openapi-generator/src/test/resources/EmvTags.java.txt
+++ b/design-first-openapi-generator/src/test/resources/EmvTags.java.txt
@@ -14,24 +14,25 @@
package ch.schlau.pesche.apidocs.openapi.designfirst.generated.model;
import java.util.Objects;
-import java.util.Arrays;
+import java.util.Map;
+import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
/**
* Collection of EMV tags
*/
-@ApiModel(description = "Collection of EMV tags")
@JsonPropertyOrder({
EmvTags.JSON_PROPERTY_84,
EmvTags.JSON_PROPERTY_9_F1_A
})
-
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class EmvTags {
public static final String JSON_PROPERTY_84 = "84";
private String _84;
@@ -39,9 +40,10 @@ public class EmvTags {
public static final String JSON_PROPERTY_9_F1_A = "9F1A";
private String _9F1A;
+ public EmvTags() {
+ }
public EmvTags _84(String _84) {
-
this._84 = _84;
return this;
}
@@ -50,8 +52,7 @@ public class EmvTags {
* The EMV AID as reported by ICC
* @return _84
**/
- @javax.annotation.Nullable
- @ApiModelProperty(value = "The EMV AID as reported by ICC")
+ @jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_84)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@@ -60,14 +61,14 @@ public class EmvTags {
}
-
+ @JsonProperty(JSON_PROPERTY_84)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void set84(String _84) {
this._84 = _84;
}
public EmvTags _9F1A(String _9F1A) {
-
this._9F1A = _9F1A;
return this;
}
@@ -76,8 +77,7 @@ public class EmvTags {
* Terminal Country Code
* @return _9F1A
**/
- @javax.annotation.Nullable
- @ApiModelProperty(value = "Terminal Country Code")
+ @jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_9_F1_A)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@@ -86,14 +86,18 @@ public class EmvTags {
}
-
+ @JsonProperty(JSON_PROPERTY_9_F1_A)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void set9F1A(String _9F1A) {
this._9F1A = _9F1A;
}
+ /**
+ * Return true if this EmvTags object is equal to o.
+ */
@Override
- public boolean equals(java.lang.Object o) {
+ public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -110,7 +114,6 @@ public class EmvTags {
return Objects.hash(_84, _9F1A);
}
-
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@@ -125,12 +128,11 @@ public class EmvTags {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
- private String toIndentedString(java.lang.Object o) {
+ private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/design-first-openapi-generator/src/test/resources/PinCheckRequest.java.txt b/design-first-openapi-generator/src/test/resources/PinCheckRequest.java.txt
index 525c1a5..0c05ad1 100644
--- a/design-first-openapi-generator/src/test/resources/PinCheckRequest.java.txt
+++ b/design-first-openapi-generator/src/test/resources/PinCheckRequest.java.txt
@@ -14,29 +14,30 @@
package ch.schlau.pesche.apidocs.openapi.designfirst.generated.model;
import java.util.Objects;
-import java.util.Arrays;
+import java.util.Map;
+import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+import java.util.Arrays;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
/**
* Request for checking a PIN
*/
-@ApiModel(description = "Request for checking a PIN")
@JsonPropertyOrder({
PinCheckRequest.JSON_PROPERTY_PAN,
PinCheckRequest.JSON_PROPERTY_PIN_BLOCK,
PinCheckRequest.JSON_PROPERTY_UUID
})
-
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class PinCheckRequest {
public static final String JSON_PROPERTY_PAN = "pan";
- private Object pan;
+ private ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model.Pan pan;
public static final String JSON_PROPERTY_PIN_BLOCK = "pinBlock";
private String pinBlock;
@@ -44,34 +45,35 @@ public class PinCheckRequest {
public static final String JSON_PROPERTY_UUID = "uuid";
private UUID uuid;
+ public PinCheckRequest() {
+ }
- public PinCheckRequest pan(Object pan) {
-
+ public PinCheckRequest pan(ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model.Pan pan) {
this.pan = pan;
return this;
}
/**
- * The number embossed on credit cards
+ * Get pan
* @return pan
**/
- @ApiModelProperty(required = true, value = "The number embossed on credit cards")
+ @jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_PAN)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
- public Object getPan() {
+ public ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model.Pan getPan() {
return pan;
}
-
- public void setPan(Object pan) {
+ @JsonProperty(JSON_PROPERTY_PAN)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public void setPan(ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model.Pan pan) {
this.pan = pan;
}
public PinCheckRequest pinBlock(String pinBlock) {
-
this.pinBlock = pinBlock;
return this;
}
@@ -80,7 +82,7 @@ public class PinCheckRequest {
* Encrypted binary data containing a PIN Fieldcode: C003
* @return pinBlock
**/
- @ApiModelProperty(required = true, value = "Encrypted binary data containing a PIN Fieldcode: C003")
+ @jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_PIN_BLOCK)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@@ -89,14 +91,14 @@ public class PinCheckRequest {
}
-
+ @JsonProperty(JSON_PROPERTY_PIN_BLOCK)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setPinBlock(String pinBlock) {
this.pinBlock = pinBlock;
}
public PinCheckRequest uuid(UUID uuid) {
-
this.uuid = uuid;
return this;
}
@@ -105,7 +107,7 @@ public class PinCheckRequest {
* Unique ID of the request
* @return uuid
**/
- @ApiModelProperty(required = true, value = "Unique ID of the request")
+ @jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_UUID)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@@ -114,14 +116,18 @@ public class PinCheckRequest {
}
-
+ @JsonProperty(JSON_PROPERTY_UUID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
+ /**
+ * Return true if this PinCheckRequest object is equal to o.
+ */
@Override
- public boolean equals(java.lang.Object o) {
+ public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -139,7 +145,6 @@ public class PinCheckRequest {
return Objects.hash(pan, pinBlock, uuid);
}
-
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@@ -155,12 +160,11 @@ public class PinCheckRequest {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
- private String toIndentedString(java.lang.Object o) {
+ private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/design-first-openapi-generator/src/test/resources/PinCheckResponse.java.txt b/design-first-openapi-generator/src/test/resources/PinCheckResponse.java.txt
index 9051eb8..0070dee 100644
--- a/design-first-openapi-generator/src/test/resources/PinCheckResponse.java.txt
+++ b/design-first-openapi-generator/src/test/resources/PinCheckResponse.java.txt
@@ -14,24 +14,25 @@
package ch.schlau.pesche.apidocs.openapi.designfirst.generated.model;
import java.util.Objects;
-import java.util.Arrays;
+import java.util.Map;
+import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
/**
* Tells if the PIN in the request was correct
*/
-@ApiModel(description = "Tells if the PIN in the request was correct")
@JsonPropertyOrder({
PinCheckResponse.JSON_PROPERTY_RESULT,
PinCheckResponse.JSON_PROPERTY_TRIES
})
-
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class PinCheckResponse {
/**
* Result of the request
@@ -74,9 +75,10 @@ public class PinCheckResponse {
public static final String JSON_PROPERTY_TRIES = "tries";
private Integer tries;
+ public PinCheckResponse() {
+ }
public PinCheckResponse result(ResultEnum result) {
-
this.result = result;
return this;
}
@@ -85,8 +87,7 @@ public class PinCheckResponse {
* Result of the request
* @return result
**/
- @javax.annotation.Nullable
- @ApiModelProperty(value = "Result of the request")
+ @jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_RESULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@@ -95,14 +96,14 @@ public class PinCheckResponse {
}
-
+ @JsonProperty(JSON_PROPERTY_RESULT)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setResult(ResultEnum result) {
this.result = result;
}
public PinCheckResponse tries(Integer tries) {
-
this.tries = tries;
return this;
}
@@ -111,8 +112,7 @@ public class PinCheckResponse {
* Number of remaining tries
* @return tries
**/
- @javax.annotation.Nullable
- @ApiModelProperty(value = "Number of remaining tries")
+ @jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TRIES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@@ -121,14 +121,18 @@ public class PinCheckResponse {
}
-
+ @JsonProperty(JSON_PROPERTY_TRIES)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setTries(Integer tries) {
this.tries = tries;
}
+ /**
+ * Return true if this PinCheckResponse object is equal to o.
+ */
@Override
- public boolean equals(java.lang.Object o) {
+ public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -145,7 +149,6 @@ public class PinCheckResponse {
return Objects.hash(result, tries);
}
-
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@@ -160,12 +163,11 @@ public class PinCheckResponse {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
- private String toIndentedString(java.lang.Object o) {
+ private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/design-first-openapi-generator/src/test/resources/PurchaseAuthRequest.java.txt b/design-first-openapi-generator/src/test/resources/PurchaseAuthRequest.java.txt
index ca2e734..8c29d9a 100644
--- a/design-first-openapi-generator/src/test/resources/PurchaseAuthRequest.java.txt
+++ b/design-first-openapi-generator/src/test/resources/PurchaseAuthRequest.java.txt
@@ -14,40 +14,42 @@
package ch.schlau.pesche.apidocs.openapi.designfirst.generated.model;
import java.util.Objects;
-import java.util.Arrays;
+import java.util.Map;
+import java.util.HashMap;
import ch.schlau.pesche.apidocs.openapi.designfirst.generated.model.EmvTags;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+import java.util.Arrays;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
/**
* Request for authorizing a Purchase
*/
-@ApiModel(description = "Request for authorizing a Purchase")
@JsonPropertyOrder({
PurchaseAuthRequest.JSON_PROPERTY_EMV_TAGS,
PurchaseAuthRequest.JSON_PROPERTY_PAN,
PurchaseAuthRequest.JSON_PROPERTY_UUID
})
-
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class PurchaseAuthRequest {
public static final String JSON_PROPERTY_EMV_TAGS = "emvTags";
private EmvTags emvTags;
public static final String JSON_PROPERTY_PAN = "pan";
- private Object pan;
+ private ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model.Pan pan;
public static final String JSON_PROPERTY_UUID = "uuid";
private UUID uuid;
+ public PurchaseAuthRequest() {
+ }
public PurchaseAuthRequest emvTags(EmvTags emvTags) {
-
this.emvTags = emvTags;
return this;
}
@@ -56,8 +58,7 @@ public class PurchaseAuthRequest {
* Get emvTags
* @return emvTags
**/
- @javax.annotation.Nullable
- @ApiModelProperty(value = "")
+ @jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_EMV_TAGS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@@ -66,39 +67,39 @@ public class PurchaseAuthRequest {
}
-
+ @JsonProperty(JSON_PROPERTY_EMV_TAGS)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setEmvTags(EmvTags emvTags) {
this.emvTags = emvTags;
}
- public PurchaseAuthRequest pan(Object pan) {
-
+ public PurchaseAuthRequest pan(ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model.Pan pan) {
this.pan = pan;
return this;
}
/**
- * The number embossed on credit cards
+ * Get pan
* @return pan
**/
- @ApiModelProperty(required = true, value = "The number embossed on credit cards")
+ @jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_PAN)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
- public Object getPan() {
+ public ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model.Pan getPan() {
return pan;
}
-
- public void setPan(Object pan) {
+ @JsonProperty(JSON_PROPERTY_PAN)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public void setPan(ch.schlau.pesche.apidocs.openapi.designfirst.txproc.model.Pan pan) {
this.pan = pan;
}
public PurchaseAuthRequest uuid(UUID uuid) {
-
this.uuid = uuid;
return this;
}
@@ -107,7 +108,7 @@ public class PurchaseAuthRequest {
* Unique ID of the request
* @return uuid
**/
- @ApiModelProperty(required = true, value = "Unique ID of the request")
+ @jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_UUID)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@@ -116,14 +117,18 @@ public class PurchaseAuthRequest {
}
-
+ @JsonProperty(JSON_PROPERTY_UUID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
+ /**
+ * Return true if this PurchaseAuthRequest object is equal to o.
+ */
@Override
- public boolean equals(java.lang.Object o) {
+ public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -141,7 +146,6 @@ public class PurchaseAuthRequest {
return Objects.hash(emvTags, pan, uuid);
}
-
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@@ -157,12 +161,11 @@ public class PurchaseAuthRequest {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
- private String toIndentedString(java.lang.Object o) {
+ private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/design-first-openapi-generator/src/test/resources/PurchaseAuthResponse.java.txt b/design-first-openapi-generator/src/test/resources/PurchaseAuthResponse.java.txt
index b374769..f19953e 100644
--- a/design-first-openapi-generator/src/test/resources/PurchaseAuthResponse.java.txt
+++ b/design-first-openapi-generator/src/test/resources/PurchaseAuthResponse.java.txt
@@ -14,24 +14,25 @@
package ch.schlau.pesche.apidocs.openapi.designfirst.generated.model;
import java.util.Objects;
-import java.util.Arrays;
+import java.util.Map;
+import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
/**
* Response to PurchaseAuthRequest
*/
-@ApiModel(description = "Response to PurchaseAuthRequest")
@JsonPropertyOrder({
PurchaseAuthResponse.JSON_PROPERTY_APPROVAL_CODE,
PurchaseAuthResponse.JSON_PROPERTY_RESULT
})
-
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class PurchaseAuthResponse {
public static final String JSON_PROPERTY_APPROVAL_CODE = "approvalCode";
private String approvalCode;
@@ -74,9 +75,10 @@ public class PurchaseAuthResponse {
public static final String JSON_PROPERTY_RESULT = "result";
private ResultEnum result;
+ public PurchaseAuthResponse() {
+ }
public PurchaseAuthResponse approvalCode(String approvalCode) {
-
this.approvalCode = approvalCode;
return this;
}
@@ -85,8 +87,7 @@ public class PurchaseAuthResponse {
* Code referencing the successful authorization
* @return approvalCode
**/
- @javax.annotation.Nullable
- @ApiModelProperty(value = "Code referencing the successful authorization")
+ @jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_APPROVAL_CODE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@@ -95,14 +96,14 @@ public class PurchaseAuthResponse {
}
-
+ @JsonProperty(JSON_PROPERTY_APPROVAL_CODE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setApprovalCode(String approvalCode) {
this.approvalCode = approvalCode;
}
public PurchaseAuthResponse result(ResultEnum result) {
-
this.result = result;
return this;
}
@@ -111,8 +112,7 @@ public class PurchaseAuthResponse {
* Result of the request
* @return result
**/
- @javax.annotation.Nullable
- @ApiModelProperty(value = "Result of the request")
+ @jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_RESULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@@ -121,14 +121,18 @@ public class PurchaseAuthResponse {
}
-
+ @JsonProperty(JSON_PROPERTY_RESULT)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setResult(ResultEnum result) {
this.result = result;
}
+ /**
+ * Return true if this PurchaseAuthResponse object is equal to o.
+ */
@Override
- public boolean equals(java.lang.Object o) {
+ public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -145,7 +149,6 @@ public class PurchaseAuthResponse {
return Objects.hash(approvalCode, result);
}
-
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@@ -160,12 +163,11 @@ public class PurchaseAuthResponse {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
- private String toIndentedString(java.lang.Object o) {
+ private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/design-first-openapi-generator/src/test/resources/openapi-sorted.yaml b/design-first-openapi-generator/src/test/resources/openapi-sorted.yaml.txt
similarity index 98%
rename from design-first-openapi-generator/src/test/resources/openapi-sorted.yaml
rename to design-first-openapi-generator/src/test/resources/openapi-sorted.yaml.txt
index d20176c..4795495 100644
--- a/design-first-openapi-generator/src/test/resources/openapi-sorted.yaml
+++ b/design-first-openapi-generator/src/test/resources/openapi-sorted.yaml.txt
@@ -1,5 +1,5 @@
---
-openapi: 3.0.0
+openapi: 3.0.3
info:
title: txproc-design-first-openapi
version: 0.9
@@ -47,11 +47,11 @@ components:
EmvTags:
description: Collection of EMV tags
properties:
- 84:
+ "84":
description: The EMV AID as reported by ICC
title: Dedicated Filename
type: string
- 9F1A:
+ "9F1A":
description: Terminal Country Code
type: string
title: EmvTags
diff --git a/design-first-openapi-generator/src/test/resources/openapi.json b/design-first-openapi-generator/src/test/resources/openapi.json
deleted file mode 100644
index aba034b..0000000
--- a/design-first-openapi-generator/src/test/resources/openapi.json
+++ /dev/null
@@ -1,179 +0,0 @@
-{
- "openapi": "3.0.0",
- "info": {
- "title": "txproc-design-first-openapi",
- "version": "0.9"
- },
- "servers": [
- {
- "url": "http://localhost:8080"
- }
- ],
- "paths": {
- "/api/txproc/pincheck": {
- "post": {
- "summary": "Check the pin",
- "operationId": "pinCheck",
- "requestBody": {
- "description": "PIN Check Request Body",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PinCheckRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "default": {
- "description": "PIN Check Response",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PinCheckResponse"
- }
- }
- }
- }
- }
- }
- },
- "/api/txproc/purchase": {
- "post": {
- "summary": "Authorize a Purchase",
- "operationId": "purchase",
- "requestBody": {
- "description": "Purchase Request Body",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PurchaseAuthRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "default": {
- "description": "Purchase Response",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PurchaseAuthResponse"
- }
- }
- }
- }
- }
- }
- }
- },
- "components": {
- "schemas": {
- "EmvTags": {
- "title": "EmvTags",
- "description": "Collection of EMV tags",
- "type": "object",
- "properties": {
- "84": {
- "title": "Dedicated Filename",
- "description": "The EMV AID as reported by ICC",
- "type": "string"
- },
- "9F1A": {
- "description": "Terminal Country Code",
- "type": "string"
- }
- }
- },
- "Pan": {
- "format": "string",
- "title": "PAN (Primary Account Number)",
- "description": "The number embossed on credit cards",
- "type": "object"
- },
- "PinCheckRequest": {
- "description": "Request for checking a PIN",
- "required": [
- "pan",
- "pinBlock",
- "uuid"
- ],
- "type": "object",
- "properties": {
- "pan": {
- "$ref": "#/components/schemas/Pan"
- },
- "pinBlock": {
- "description": "Encrypted binary data containing a PIN\n\nFieldcode: C003",
- "type": "string"
- },
- "uuid": {
- "format": "uuid",
- "description": "Unique ID of the request",
- "type": "string"
- }
- }
- },
- "PinCheckResponse": {
- "description": "Tells if the PIN in the request was correct",
- "type": "object",
- "properties": {
- "result": {
- "description": "Result of the request",
- "enum": [
- "OK",
- "WRONG"
- ],
- "type": "string"
- },
- "tries": {
- "format": "int32",
- "description": "Number of remaining tries",
- "type": "integer"
- }
- }
- },
- "PurchaseAuthRequest": {
- "description": "Request for authorizing a Purchase",
- "required": [
- "pan",
- "uuid"
- ],
- "type": "object",
- "properties": {
- "emvTags": {
- "$ref": "#/components/schemas/EmvTags"
- },
- "pan": {
- "$ref": "#/components/schemas/Pan"
- },
- "uuid": {
- "format": "uuid",
- "description": "Unique ID of the request",
- "type": "string"
- }
- }
- },
- "PurchaseAuthResponse": {
- "description": "Response to PurchaseAuthRequest",
- "type": "object",
- "properties": {
- "approvalCode": {
- "description": "Code referencing the successful authorization",
- "type": "string"
- },
- "result": {
- "description": "Result of the request",
- "enum": [
- "OK",
- "WRONG"
- ],
- "type": "string"
- }
- }
- }
- }
- }
-}
diff --git a/design-first-openapi-generator/src/test/resources/openapi.json.txt b/design-first-openapi-generator/src/test/resources/openapi.json.txt
new file mode 100644
index 0000000..cd4e4d0
--- /dev/null
+++ b/design-first-openapi-generator/src/test/resources/openapi.json.txt
@@ -0,0 +1,164 @@
+{
+ "openapi" : "3.0.3",
+ "info" : {
+ "title" : "txproc-design-first-openapi",
+ "version" : "0.9"
+ },
+ "servers" : [ {
+ "url" : "http://localhost:8080"
+ } ],
+ "paths" : {
+ "/api/txproc/pincheck" : {
+ "post" : {
+ "summary" : "Check the pin",
+ "operationId" : "pinCheck",
+ "requestBody" : {
+ "description" : "PIN Check Request Body",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PinCheckRequest"
+ }
+ }
+ },
+ "required" : true
+ },
+ "responses" : {
+ "default" : {
+ "description" : "PIN Check Response",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PinCheckResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/txproc/purchase" : {
+ "post" : {
+ "summary" : "Authorize a Purchase",
+ "operationId" : "purchase",
+ "requestBody" : {
+ "description" : "Purchase Request Body",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PurchaseAuthRequest"
+ }
+ }
+ },
+ "required" : true
+ },
+ "responses" : {
+ "default" : {
+ "description" : "Purchase Response",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PurchaseAuthResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components" : {
+ "schemas" : {
+ "EmvTags" : {
+ "title" : "EmvTags",
+ "description" : "Collection of EMV tags",
+ "type" : "object",
+ "properties" : {
+ "84" : {
+ "title" : "Dedicated Filename",
+ "description" : "The EMV AID as reported by ICC",
+ "type" : "string"
+ },
+ "9F1A" : {
+ "description" : "Terminal Country Code",
+ "type" : "string"
+ }
+ }
+ },
+ "Pan" : {
+ "format" : "string",
+ "title" : "PAN (Primary Account Number)",
+ "description" : "The number embossed on credit cards",
+ "type" : "object"
+ },
+ "PinCheckRequest" : {
+ "description" : "Request for checking a PIN",
+ "required" : [ "pan", "pinBlock", "uuid" ],
+ "type" : "object",
+ "properties" : {
+ "pan" : {
+ "$ref" : "#/components/schemas/Pan"
+ },
+ "pinBlock" : {
+ "description" : "Encrypted binary data containing a PIN\n\nFieldcode: C003",
+ "type" : "string"
+ },
+ "uuid" : {
+ "format" : "uuid",
+ "description" : "Unique ID of the request",
+ "type" : "string"
+ }
+ }
+ },
+ "PinCheckResponse" : {
+ "description" : "Tells if the PIN in the request was correct",
+ "type" : "object",
+ "properties" : {
+ "result" : {
+ "description" : "Result of the request",
+ "enum" : [ "OK", "WRONG" ],
+ "type" : "string"
+ },
+ "tries" : {
+ "format" : "int32",
+ "description" : "Number of remaining tries",
+ "type" : "integer"
+ }
+ }
+ },
+ "PurchaseAuthRequest" : {
+ "description" : "Request for authorizing a Purchase",
+ "required" : [ "pan", "uuid" ],
+ "type" : "object",
+ "properties" : {
+ "emvTags" : {
+ "$ref" : "#/components/schemas/EmvTags"
+ },
+ "pan" : {
+ "$ref" : "#/components/schemas/Pan"
+ },
+ "uuid" : {
+ "format" : "uuid",
+ "description" : "Unique ID of the request",
+ "type" : "string"
+ }
+ }
+ },
+ "PurchaseAuthResponse" : {
+ "description" : "Response to PurchaseAuthRequest",
+ "type" : "object",
+ "properties" : {
+ "approvalCode" : {
+ "description" : "Code referencing the successful authorization",
+ "type" : "string"
+ },
+ "result" : {
+ "description" : "Result of the request",
+ "enum" : [ "OK", "WRONG" ],
+ "type" : "string"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/design-first-openapi-generator/src/test/resources/openapi.yaml b/design-first-openapi-generator/src/test/resources/openapi.yaml.txt
similarity index 98%
rename from design-first-openapi-generator/src/test/resources/openapi.yaml
rename to design-first-openapi-generator/src/test/resources/openapi.yaml.txt
index 87d016e..eb60257 100644
--- a/design-first-openapi-generator/src/test/resources/openapi.yaml
+++ b/design-first-openapi-generator/src/test/resources/openapi.yaml.txt
@@ -1,5 +1,5 @@
---
-openapi: 3.0.0
+openapi: 3.0.3
info:
title: txproc-design-first-openapi
version: "0.9"
@@ -49,11 +49,11 @@ components:
description: Collection of EMV tags
type: object
properties:
- 84:
+ "84":
title: Dedicated Filename
description: The EMV AID as reported by ICC
type: string
- 9F1A:
+ "9F1A":
description: Terminal Country Code
type: string
Pan:
diff --git a/design-first-swagger-openliberty/README.md b/design-first-swagger-openliberty/README.md
deleted file mode 100644
index 78dac8b..0000000
--- a/design-first-swagger-openliberty/README.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# OpenAPI design-first approach with OpenLiberty server and Swagger Codegen
-
-This directory contains a simple service implemented
-
-- using the *design-first* approach to provide an OpenAPI document
-- running with [OpenLiberty](https://openliberty.io/) server (providing the
- MicroProfile [OpenAPI](https://openliberty.io/guides/microprofile-openapi.html)
- endpoints), serving the static hand-written OpenAPI document that
- is also used to generate the POJOs of the service interface
-- the POJOs are generated using [Swagger Codegen](https://swagger.io/tools/swagger-codegen/)'s
- Maven [plugin](https://github.com/swagger-api/swagger-codegen/tree/3.0.0/modules/swagger-codegen-maven-plugin)
-
-For more information consult the [README](../README.adoc) in the parent directory.
-
-## How to run the service
-
-Using OpenLiberty's [dev mode](https://openliberty.io/blog/2019/10/17/dev-mode-developer-experience.html):
-
- mvn liberty:dev
-
-Once the service runs:
-
-- http://localhost:8080/openapi fetches the OpenAPI document
-- http://localhost:8080/openapi/ui shows an interactive view of the API (based on Swagger-UI)
diff --git a/design-first-swagger-openliberty/pom.xml b/design-first-swagger-openliberty/pom.xml
deleted file mode 100644
index 91668c3..0000000
--- a/design-first-swagger-openliberty/pom.xml
+++ /dev/null
@@ -1,345 +0,0 @@
-
-
- 4.0.0
-
- ch.schlau.pesche.apidocs
- design-first-swagger-openliberty
- 0.9-SNAPSHOT
- war
-
- apidocs.${project.artifactId}
-
-
- UTF-8
-
-
-
- 11
-
-
- 2.10.0
- 1.18.10
- 19.0.0.10
- 2.0.10
- 3.0.11
-
-
- 5.5.2
- 2.2
- 2.10.0
- 4.1.2
- 2.6
- 1.0.5
- 1.1.4
-
-
- 3.1
- 3.8.1
- 2.22.2
- 2.22.2
- 3.2.3
-
- ${project.build.directory}/generated-sources/swagger
-
-
- 8080
- 8443
-
-
-
-
-
- io.openliberty.features
- features-bom
- ${openliberty.version}
- pom
- import
-
-
-
-
-
-
-
- io.openliberty.features
- jaxrs-2.1
- esa
- provided
-
-
- io.openliberty.features
- jsonp-1.1
- esa
- provided
-
-
- io.openliberty.features
- jsonb-1.0
- esa
- provided
-
-
- io.openliberty.features
- cdi-2.0
- esa
- provided
-
-
- io.openliberty.features
- beanValidation-2.0
- esa
- provided
-
-
- io.openliberty.features
- mpConfig-1.3
- esa
- provided
-
-
- io.openliberty.features
- mpOpenAPI-1.1
- esa
- provided
-
-
-
-
-
- com.fasterxml.jackson.core
- jackson-annotations
- ${jackson-2-version}
- provided
-
-
- com.fasterxml.jackson.core
- jackson-databind
- ${jackson-2-version}
- provided
-
-
- io.swagger.core.v3
- swagger-annotations
- ${swagger.version}
-
-
-
-
- org.projectlombok
- lombok
- ${lombok.version}
- provided
-
-
-
-
- org.junit.jupiter
- junit-jupiter
- ${junit.jupiter.version}
- test
-
-
- org.hamcrest
- hamcrest
- ${hamcrest.version}
- test
-
-
-
- org.glassfish
- javax.json
- ${glassfish.javax.json.version}
- test
-
-
-
- org.eclipse
- yasson
- ${yasson.version}
- test
-
-
- io.rest-assured
- rest-assured
- ${restassured.version}
- test
-
-
- com.sun.xml.bind
- jaxb-osgi
-
-
-
-
- net.javacrumbs.json-unit
- json-unit
- ${json.unit.version}
- test
-
-
- commons-io
- commons-io
- ${commons-io.version}
- test
-
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-yaml
- ${jackson-2-version}
- test
-
-
-
-
-
-
- io.swagger.codegen.v3
- swagger-codegen-maven-plugin
- ${swagger.codegen.version}
-
-
-
- generate
-
-
- ${project.basedir}/src/main/webapp/META-INF/openapi.yaml
- java
- false
- false
- false
- ${project.basedir}/src/main/resources/.openapi-generator-ignore
-
-
- true
- java8
- resteasy
- false
- .
- ch.schlau.pesche.apidocs.swagger.designfirst.generated.model
-
-
-
- hideGenerationTimestamp=true
-
-
- Pan=ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan
-
-
-
-
-
-
- io.openliberty.tools
- liberty-maven-plugin
- ${liberty.plugin.version}
-
-
- io.openliberty
- openliberty-runtime
- ${openliberty.version}
- zip
-
- usr
-
- ${liberty.http.port}
- ${liberty.https.port}
-
-
-
-
- install-liberty
- prepare-package
-
- install-server
-
-
-
- create-default-server
- prepare-package
-
- create
-
-
-
- install-app
- package
-
- deploy
-
-
- apps
- true
-
-
-
- start-server
- pre-integration-test
-
- test-start
-
-
-
- stop-server
- post-integration-test
-
- test-stop
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- ${maven.compiler.plugin.version}
-
-
- ${java.release}
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- ${maven.surefire.plugin.version}
-
-
- ${generated.path}
-
-
-
-
- org.apache.maven.plugins
- maven-failsafe-plugin
- ${maven.failsafe.plugin.version}
-
-
- integration-test
- integration-test
-
- integration-test
-
-
-
- ${liberty.http.port}
-
-
-
-
- verify-results
-
- verify
-
-
-
-
-
- org.apache.maven.plugins
- maven-war-plugin
- ${maven.war.plugin.version}
-
- false
-
-
-
-
-
diff --git a/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JaxrsApplication.java b/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JaxrsApplication.java
deleted file mode 100644
index cffd174..0000000
--- a/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JaxrsApplication.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package ch.schlau.pesche.apidocs.swagger.designfirst.rest;
-
-import javax.ws.rs.ApplicationPath;
-import javax.ws.rs.core.Application;
-
-@ApplicationPath("/api")
-public class JaxrsApplication extends Application {
-}
diff --git a/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonConfiguration.java b/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonConfiguration.java
deleted file mode 100644
index 4a1acc5..0000000
--- a/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonConfiguration.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package ch.schlau.pesche.apidocs.swagger.designfirst.rest;
-
-import javax.json.bind.Jsonb;
-import javax.json.bind.JsonbBuilder;
-import javax.json.bind.JsonbConfig;
-
-import ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.PanJsonAdapter;
-import lombok.experimental.UtilityClass;
-
-@UtilityClass
-public class JsonConfiguration {
-
- public static final JsonbConfig JSON_CONFIG = new JsonbConfig()
- .withAdapters(new PanJsonAdapter())
- ;
-
- public static final Jsonb JSONB = JsonbBuilder.create(JSON_CONFIG);
-}
\ No newline at end of file
diff --git a/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonContextResolver.java b/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonContextResolver.java
deleted file mode 100644
index fc3df3f..0000000
--- a/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonContextResolver.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package ch.schlau.pesche.apidocs.swagger.designfirst.rest;
-
-import static ch.schlau.pesche.apidocs.swagger.designfirst.rest.JsonConfiguration.JSONB;
-
-import javax.json.bind.Jsonb;
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.Provider;
-
-@Provider
-public class JsonContextResolver implements ContextResolver {
-
- private final Jsonb jsonb;
-
- public JsonContextResolver() {
- jsonb = JSONB;
- }
-
- @Override
- public Jsonb getContext(Class> type) {
- return jsonb;
- }
-}
diff --git a/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProc.java b/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProc.java
deleted file mode 100644
index 828df91..0000000
--- a/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProc.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package ch.schlau.pesche.apidocs.swagger.designfirst.rest;
-
-import java.util.Optional;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.EmvTags;
-import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.PinCheckRequest;
-import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.PinCheckResponse;
-import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.PurchaseAuthRequest;
-import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.PurchaseAuthResponse;
-import ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan;
-
-@Path("/txproc")
-@Consumes(MediaType.APPLICATION_JSON)
-@Produces(MediaType.APPLICATION_JSON)
-public class TxProc {
-
- @Path("/pincheck")
- @POST
- public PinCheckResponse pinCheck(PinCheckRequest request) {
-
- PinCheckResponse response = new PinCheckResponse();
- if ("magic".equals(request.getPinBlock())) {
- response.setResult(PinCheckResponse.ResultEnum.OK);
- response.setTries(3);
- } else {
- response.setResult(PinCheckResponse.ResultEnum.WRONG);
- }
- return response;
- }
-
- @Path("/purchase")
- @POST
- public PurchaseAuthResponse purchase(PurchaseAuthRequest request) {
-
- PurchaseAuthResponse response = new PurchaseAuthResponse();
- if (Optional.ofNullable(request.getPan())
- .map(Pan::getPan)
- .filter(s -> s.startsWith("42"))
- .isPresent()) {
- response.setResult(PurchaseAuthResponse.ResultEnum.OK);
- response.setApprovalCode("OK42." +
- Optional.ofNullable(request.getEmvTags()).map(EmvTags::get9f1A).orElse("756"));
- } else {
- response.setResult(PurchaseAuthResponse.ResultEnum.WRONG);
- }
- return response;
- }
-}
diff --git a/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/Pan.java b/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/Pan.java
deleted file mode 100644
index 40637b4..0000000
--- a/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/Pan.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model;
-
-import javax.validation.constraints.Pattern;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-/**
- * PAN (Primary Account Number)
- *
- * The number embossed on credit cards
- */
-@Getter
-@Setter
-@AllArgsConstructor
-@NoArgsConstructor
-public class Pan {
-
- @Pattern(regexp = "[0-9]{12,19}")
- private String pan;
-
- /**
- * For data protection reasons (PCI-DSS compliance) the complete PAN must not
- * be shown unless absolutely needed. This method masks out the middle digits
- * of the PAN, allowing the result to be safely displayed (e.g. on receipts)
- *
- * @return PAN with the middle digits safely replaced by 'x' characters
- */
- public String asMaskedPan() {
- if (pan != null && pan.length() >= 12 && pan.length() <= 19) {
- int lastPos = pan.length() - 4;
- return new StringBuilder(pan).replace(6, lastPos, "xxxxxxxxxxxxxxxxxxx".substring(0, lastPos - 6)).toString();
- } else {
- return pan;
- }
- }
-}
diff --git a/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanJsonAdapter.java b/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanJsonAdapter.java
deleted file mode 100644
index 14f9c51..0000000
--- a/design-first-swagger-openliberty/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanJsonAdapter.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model;
-
-import javax.json.bind.adapter.JsonbAdapter;
-
-public class PanJsonAdapter implements JsonbAdapter {
- @Override
- public String adaptToJson(Pan pan) throws Exception {
- return pan.getPan();
- }
-
- @Override
- public Pan adaptFromJson(String s) throws Exception {
- return new Pan(s);
- }
-}
diff --git a/design-first-swagger-openliberty/src/main/liberty/config/server.xml b/design-first-swagger-openliberty/src/main/liberty/config/server.xml
deleted file mode 100644
index d0c603a..0000000
--- a/design-first-swagger-openliberty/src/main/liberty/config/server.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- jaxrs-2.1
- jsonp-1.1
- jsonb-1.0
- cdi-2.0
- beanValidation-2.0
- mpConfig-1.3
- mpOpenAPI-1.1
-
-
-
-
-
-
-
-
-
diff --git a/design-first-swagger-openliberty/src/main/resources/.openapi-generator-ignore b/design-first-swagger-openliberty/src/main/resources/.openapi-generator-ignore
deleted file mode 100644
index 2a27b92..0000000
--- a/design-first-swagger-openliberty/src/main/resources/.openapi-generator-ignore
+++ /dev/null
@@ -1,5 +0,0 @@
-# file similar to `.gitignore` (using the same syntax)
-# with file patterns that should not be generated by the code generation plugin
-#
-# this file is empty and serves just to suppress this warning:
-# "Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated."
\ No newline at end of file
diff --git a/design-first-swagger-openliberty/src/main/webapp/META-INF/microprofile-config.properties b/design-first-swagger-openliberty/src/main/webapp/META-INF/microprofile-config.properties
deleted file mode 100644
index ac79149..0000000
--- a/design-first-swagger-openliberty/src/main/webapp/META-INF/microprofile-config.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-# the OpenAPI document is provided as source (design-first), no annotation scan needed
-mp.openapi.scan.disable = true
diff --git a/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/OpenapiDocumentIT.java b/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/OpenapiDocumentIT.java
deleted file mode 100644
index 7c9d3e9..0000000
--- a/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/OpenapiDocumentIT.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package ch.schlau.pesche.apidocs.swagger.designfirst;
-
-import static com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature.MINIMIZE_QUOTES;
-import static io.restassured.RestAssured.given;
-import static io.restassured.RestAssured.when;
-import static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertAll;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.commons.io.IOUtils;
-import org.junit.jupiter.api.Test;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
-
-import lombok.Getter;
-import lombok.Setter;
-
-class OpenapiDocumentIT {
-
- @Getter
- @Setter
- static class OpenapiSkeleton {
- String openapi;
- Object info;
- Object servers;
- Object paths;
- Object components;
- Object security;
- Object tags;
- Object externalDocs;
- }
-
- @Test
- void openapi_yaml() throws IOException {
-
- String expected = loadResourceFile("openapi.yaml");
- String expectedSorted = loadResourceFile("openapi-sorted.yaml");
-
- String document = when().get("/openapi")
- .then()
- .statusCode(200)
- .extract().response().asString();
-
- String yamlSorted = sortYaml(document);
-
- assertAll("openapi yaml"
- , () -> assertThat("unsorted", document, is(expected))
- , () -> assertThat("sorted", yamlSorted, is(expectedSorted))
- );
- }
-
- @Test
- void openapi_json() throws IOException {
-
- String expected = loadResourceFile("openapi.json");
-
- String document = given().accept(MediaType.APPLICATION_JSON)
- .when().get("/openapi")
- .then()
- .statusCode(200)
- .assertThat().contentType(MediaType.APPLICATION_JSON)
- .extract().response().asString();
-
- assertThat(document, jsonEquals(expected));
- }
-
- private String sortYaml(String yaml) throws IOException {
- ObjectMapper yamlMapper = new ObjectMapper(new YAMLFactory().enable(MINIMIZE_QUOTES));
- OpenapiSkeleton objFromYaml = yamlMapper.readValue(yaml, OpenapiSkeleton.class);
-
- ObjectMapper jsonMapper = new ObjectMapper()
- .setSerializationInclusion(JsonInclude.Include.NON_NULL)
- .configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
- String jsonSorted = jsonMapper.writeValueAsString(objFromYaml);
- Object objFromJson = jsonMapper.readValue(jsonSorted, Object.class);
-
- return yamlMapper.writeValueAsString(objFromJson);
- }
-
- private String loadResourceFile(String s) throws IOException {
- return IOUtils.toString(getClass().getClassLoader().getResourceAsStream(s), StandardCharsets.UTF_8)
- // needed on Windows depending on the Git configuration (core.autocrlf)
- .replace("\r\n", "\n");
- }
-}
diff --git a/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/generated/GenerationTest.java b/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/generated/GenerationTest.java
deleted file mode 100644
index ec22ef1..0000000
--- a/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/generated/GenerationTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package ch.schlau.pesche.apidocs.swagger.designfirst.generated;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import org.apache.commons.io.IOUtils;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.ValueSource;
-
-import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.EmvTags;
-import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.PinCheckRequest;
-import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.PinCheckResponse;
-import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.PurchaseAuthRequest;
-import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.PurchaseAuthResponse;
-
-class GenerationTest {
-
- private static final String FILE_SEPARATOR = System.getProperty("file.separator");
-
- @ParameterizedTest
- @ValueSource(classes = {
- EmvTags.class,
- PinCheckRequest.class,
- PinCheckResponse.class,
- PurchaseAuthRequest.class,
- PurchaseAuthResponse.class
- })
- void compare_generated_classes(Class clazz) throws IOException {
-
- String generated = loadGeneratedSourceFile(clazz);
- String expected = loadExpectedSourceFile(clazz);
-
- assertThat(generated, is(expected));
- }
-
- private String loadGeneratedSourceFile(Class clazz) throws IOException {
-
- // set in maven pom.xml or the run configuration
- String directoryGenerated = System.getProperty("generated.path");
- String generatedSourcePath = clazz.getName().replace(".", FILE_SEPARATOR) + ".java";
- Path path = Paths.get(directoryGenerated, generatedSourcePath);
-
- return IOUtils.toString(path.toUri(), StandardCharsets.UTF_8);
- }
-
- private String loadExpectedSourceFile(Class clazz) throws IOException {
-
- String fileName = clazz.getSimpleName() + ".java.txt";
- return IOUtils.toString(getClass().getClassLoader().getResourceAsStream(fileName), StandardCharsets.UTF_8)
- // needed on Windows depending on the Git configuration (core.autocrlf)
- .replace("\r\n", "\n");
- }
-}
diff --git a/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPincheckIT.java b/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPincheckIT.java
deleted file mode 100644
index 6e2928c..0000000
--- a/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPincheckIT.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package ch.schlau.pesche.apidocs.swagger.designfirst.rest;
-
-import static io.restassured.RestAssured.given;
-import static org.hamcrest.CoreMatchers.is;
-
-import javax.ws.rs.core.MediaType;
-
-import org.junit.jupiter.api.Test;
-
-class TxProcPincheckIT {
-
- @Test
- void pincheck_ok() {
- // @formatter:off
- given()
- .header("Content-Type", MediaType.APPLICATION_JSON)
- .body("{\"uuid\": \"aaaaaaaa-bbbb-cccc-dddd-012345678901\", \"pinBlock\": \"magic\"}")
- .when()
- .post("/api/txproc/pincheck")
- .then()
- .statusCode(200)
- .body("result", is("OK"))
- .body("tries", is(3))
- ;
- // @formatter:off
- }
-}
\ No newline at end of file
diff --git a/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPurchaseIT.java b/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPurchaseIT.java
deleted file mode 100644
index c262064..0000000
--- a/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPurchaseIT.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package ch.schlau.pesche.apidocs.swagger.designfirst.rest;
-
-import static io.restassured.RestAssured.given;
-import static org.hamcrest.CoreMatchers.is;
-
-import javax.ws.rs.core.MediaType;
-
-import org.junit.jupiter.api.Test;
-
-class TxProcPurchaseIT {
-
- @Test
- void purchase_ok() {
- // @formatter:off
- given()
- .header("Content-Type", MediaType.APPLICATION_JSON)
- .body("{\"uuid\": \"aaaaaaaa-bbbb-cccc-dddd-012345678901\","
- +" \"pan\": \"4244333322221111\","
- +" \"emvTags\": { \"84\": \"A0000000041010\", \"9f1A\": \"250\" } }")
- .when()
- .post("/api/txproc/purchase")
- .then()
- .statusCode(200)
- .body("result", is("OK"))
- .body("approvalCode", is("OK42.250"))
- ;
- // @formatter:off
- }
-}
\ No newline at end of file
diff --git a/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanTest.java b/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanTest.java
deleted file mode 100644
index a4f118b..0000000
--- a/design-first-swagger-openliberty/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model;
-
-import static ch.schlau.pesche.apidocs.swagger.designfirst.rest.JsonConfiguration.JSONB;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import javax.json.bind.Jsonb;
-
-import org.junit.jupiter.api.Test;
-
-class PanTest {
-
- @Test
- void asMaskedPan_valid() {
-
- assertThat(new Pan("123456789012").asMaskedPan(), is("123456xx9012"));
- assertThat(new Pan("1234567890123456789").asMaskedPan(), is("123456xxxxxxxxx6789"));
- }
-
- @Test
- void asMaskedPan_invalid() {
-
- assertThat(new Pan(null).asMaskedPan(), is(nullValue()));
- assertThat(new Pan("1234567890").asMaskedPan(), is("1234567890"));
- assertThat(new Pan("12345678901234567890").asMaskedPan(), is("12345678901234567890"));
- }
-
- @Test
- void json_roundtrip() {
-
- Jsonb jsonb = JSONB;
-
- Pan pan = new Pan("4444333322221111");
-
- // JSON serialization
- String jsonString = jsonb.toJson(pan);
- assertThat(jsonString, is("\"4444333322221111\""));
-
- // JSON deserialization
- Pan roundtrip = jsonb.fromJson(jsonString, Pan.class);
- assertThat(roundtrip.getPan(), is("4444333322221111"));
- }
-}
\ No newline at end of file
diff --git a/design-first-swagger-openliberty/src/test/resources/.editorconfig b/design-first-swagger-openliberty/src/test/resources/.editorconfig
deleted file mode 100644
index 42344b9..0000000
--- a/design-first-swagger-openliberty/src/test/resources/.editorconfig
+++ /dev/null
@@ -1,2 +0,0 @@
-[*.txt]
-trim_trailing_whitespace = false
diff --git a/design-first-swagger-openliberty/src/test/resources/EmvTags.java.txt b/design-first-swagger-openliberty/src/test/resources/EmvTags.java.txt
deleted file mode 100644
index aef444d..0000000
--- a/design-first-swagger-openliberty/src/test/resources/EmvTags.java.txt
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * txproc-design-first-swagger-openliberty
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * OpenAPI spec version: 0.9
- *
- *
- * NOTE: This class is auto generated by the swagger code generator program.
- * https://github.com/swagger-api/swagger-codegen.git
- * Do not edit the class manually.
- */
-
-package ch.schlau.pesche.apidocs.swagger.designfirst.generated.model;
-
-import java.util.Objects;
-import java.util.Arrays;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.v3.oas.annotations.media.Schema;
-/**
- * Collection of EMV tags
- */
-@Schema(description = "Collection of EMV tags")
-
-public class EmvTags {
- @JsonProperty("84")
- private String _84 = null;
-
- @JsonProperty("9F1A")
- private String _9f1A = null;
-
- public EmvTags _84(String _84) {
- this._84 = _84;
- return this;
- }
-
- /**
- * The EMV AID as reported by ICC
- * @return _84
- **/
- @Schema(description = "The EMV AID as reported by ICC")
- public String get84() {
- return _84;
- }
-
- public void set84(String _84) {
- this._84 = _84;
- }
-
- public EmvTags _9f1A(String _9f1A) {
- this._9f1A = _9f1A;
- return this;
- }
-
- /**
- * Terminal Country Code
- * @return _9f1A
- **/
- @Schema(description = "Terminal Country Code")
- public String get9f1A() {
- return _9f1A;
- }
-
- public void set9f1A(String _9f1A) {
- this._9f1A = _9f1A;
- }
-
-
- @Override
- public boolean equals(java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- EmvTags emvTags = (EmvTags) o;
- return Objects.equals(this._84, emvTags._84) &&
- Objects.equals(this._9f1A, emvTags._9f1A);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(_84, _9f1A);
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class EmvTags {\n");
-
- sb.append(" _84: ").append(toIndentedString(_84)).append("\n");
- sb.append(" _9f1A: ").append(toIndentedString(_9f1A)).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/design-first-swagger-openliberty/src/test/resources/PinCheckRequest.java.txt b/design-first-swagger-openliberty/src/test/resources/PinCheckRequest.java.txt
deleted file mode 100644
index c36d8a9..0000000
--- a/design-first-swagger-openliberty/src/test/resources/PinCheckRequest.java.txt
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * txproc-design-first-swagger-openliberty
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * OpenAPI spec version: 0.9
- *
- *
- * NOTE: This class is auto generated by the swagger code generator program.
- * https://github.com/swagger-api/swagger-codegen.git
- * Do not edit the class manually.
- */
-
-package ch.schlau.pesche.apidocs.swagger.designfirst.generated.model;
-
-import java.util.Objects;
-import java.util.Arrays;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.v3.oas.annotations.media.Schema;
-import java.util.UUID;
-/**
- * Request for checking a PIN
- */
-@Schema(description = "Request for checking a PIN")
-
-public class PinCheckRequest {
- @JsonProperty("pan")
- private ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan pan = null;
-
- @JsonProperty("pinBlock")
- private String pinBlock = null;
-
- @JsonProperty("uuid")
- private UUID uuid = null;
-
- public PinCheckRequest pan(ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan pan) {
- this.pan = pan;
- return this;
- }
-
- /**
- * Get pan
- * @return pan
- **/
- @Schema(required = true, description = "")
- public ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan getPan() {
- return pan;
- }
-
- public void setPan(ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan pan) {
- this.pan = pan;
- }
-
- public PinCheckRequest pinBlock(String pinBlock) {
- this.pinBlock = pinBlock;
- return this;
- }
-
- /**
- * Encrypted binary data containing a PIN Fieldcode: C003
- * @return pinBlock
- **/
- @Schema(required = true, description = "Encrypted binary data containing a PIN Fieldcode: C003")
- public String getPinBlock() {
- return pinBlock;
- }
-
- public void setPinBlock(String pinBlock) {
- this.pinBlock = pinBlock;
- }
-
- public PinCheckRequest uuid(UUID uuid) {
- this.uuid = uuid;
- return this;
- }
-
- /**
- * Unique ID of the request
- * @return uuid
- **/
- @Schema(required = true, description = "Unique ID of the request")
- public UUID getUuid() {
- return uuid;
- }
-
- public void setUuid(UUID uuid) {
- this.uuid = uuid;
- }
-
-
- @Override
- public boolean equals(java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- PinCheckRequest pinCheckRequest = (PinCheckRequest) o;
- return Objects.equals(this.pan, pinCheckRequest.pan) &&
- Objects.equals(this.pinBlock, pinCheckRequest.pinBlock) &&
- Objects.equals(this.uuid, pinCheckRequest.uuid);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(pan, pinBlock, uuid);
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class PinCheckRequest {\n");
-
- sb.append(" pan: ").append(toIndentedString(pan)).append("\n");
- sb.append(" pinBlock: ").append(toIndentedString(pinBlock)).append("\n");
- sb.append(" uuid: ").append(toIndentedString(uuid)).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/design-first-swagger-openliberty/src/test/resources/PinCheckResponse.java.txt b/design-first-swagger-openliberty/src/test/resources/PinCheckResponse.java.txt
deleted file mode 100644
index c71b99d..0000000
--- a/design-first-swagger-openliberty/src/test/resources/PinCheckResponse.java.txt
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * txproc-design-first-swagger-openliberty
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * OpenAPI spec version: 0.9
- *
- *
- * NOTE: This class is auto generated by the swagger code generator program.
- * https://github.com/swagger-api/swagger-codegen.git
- * Do not edit the class manually.
- */
-
-package ch.schlau.pesche.apidocs.swagger.designfirst.generated.model;
-
-import java.util.Objects;
-import java.util.Arrays;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.v3.oas.annotations.media.Schema;
-/**
- * Tells if the PIN in the request was correct
- */
-@Schema(description = "Tells if the PIN in the request was correct")
-
-public class PinCheckResponse {
- /**
- * Result of the request
- */
- public enum ResultEnum {
- OK("OK"),
- WRONG("WRONG");
-
- private String value;
-
- ResultEnum(String value) {
- this.value = value;
- }
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
- @JsonCreator
- public static ResultEnum fromValue(String text) {
- for (ResultEnum b : ResultEnum.values()) {
- if (String.valueOf(b.value).equals(text)) {
- return b;
- }
- }
- return null;
- }
-
- } @JsonProperty("result")
- private ResultEnum result = null;
-
- @JsonProperty("tries")
- private Integer tries = null;
-
- public PinCheckResponse result(ResultEnum result) {
- this.result = result;
- return this;
- }
-
- /**
- * Result of the request
- * @return result
- **/
- @Schema(description = "Result of the request")
- public ResultEnum getResult() {
- return result;
- }
-
- public void setResult(ResultEnum result) {
- this.result = result;
- }
-
- public PinCheckResponse tries(Integer tries) {
- this.tries = tries;
- return this;
- }
-
- /**
- * Number of remaining tries
- * @return tries
- **/
- @Schema(description = "Number of remaining tries")
- public Integer getTries() {
- return tries;
- }
-
- public void setTries(Integer tries) {
- this.tries = tries;
- }
-
-
- @Override
- public boolean equals(java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- PinCheckResponse pinCheckResponse = (PinCheckResponse) o;
- return Objects.equals(this.result, pinCheckResponse.result) &&
- Objects.equals(this.tries, pinCheckResponse.tries);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(result, tries);
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class PinCheckResponse {\n");
-
- sb.append(" result: ").append(toIndentedString(result)).append("\n");
- sb.append(" tries: ").append(toIndentedString(tries)).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/design-first-swagger-openliberty/src/test/resources/PurchaseAuthRequest.java.txt b/design-first-swagger-openliberty/src/test/resources/PurchaseAuthRequest.java.txt
deleted file mode 100644
index 07091bc..0000000
--- a/design-first-swagger-openliberty/src/test/resources/PurchaseAuthRequest.java.txt
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * txproc-design-first-swagger-openliberty
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * OpenAPI spec version: 0.9
- *
- *
- * NOTE: This class is auto generated by the swagger code generator program.
- * https://github.com/swagger-api/swagger-codegen.git
- * Do not edit the class manually.
- */
-
-package ch.schlau.pesche.apidocs.swagger.designfirst.generated.model;
-
-import java.util.Objects;
-import java.util.Arrays;
-import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.EmvTags;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.v3.oas.annotations.media.Schema;
-import java.util.UUID;
-/**
- * Request for authorizing a Purchase
- */
-@Schema(description = "Request for authorizing a Purchase")
-
-public class PurchaseAuthRequest {
- @JsonProperty("emvTags")
- private EmvTags emvTags = null;
-
- @JsonProperty("pan")
- private ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan pan = null;
-
- @JsonProperty("uuid")
- private UUID uuid = null;
-
- public PurchaseAuthRequest emvTags(EmvTags emvTags) {
- this.emvTags = emvTags;
- return this;
- }
-
- /**
- * Get emvTags
- * @return emvTags
- **/
- @Schema(description = "")
- public EmvTags getEmvTags() {
- return emvTags;
- }
-
- public void setEmvTags(EmvTags emvTags) {
- this.emvTags = emvTags;
- }
-
- public PurchaseAuthRequest pan(ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan pan) {
- this.pan = pan;
- return this;
- }
-
- /**
- * Get pan
- * @return pan
- **/
- @Schema(required = true, description = "")
- public ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan getPan() {
- return pan;
- }
-
- public void setPan(ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan pan) {
- this.pan = pan;
- }
-
- public PurchaseAuthRequest uuid(UUID uuid) {
- this.uuid = uuid;
- return this;
- }
-
- /**
- * Unique ID of the request
- * @return uuid
- **/
- @Schema(required = true, description = "Unique ID of the request")
- public UUID getUuid() {
- return uuid;
- }
-
- public void setUuid(UUID uuid) {
- this.uuid = uuid;
- }
-
-
- @Override
- public boolean equals(java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- PurchaseAuthRequest purchaseAuthRequest = (PurchaseAuthRequest) o;
- return Objects.equals(this.emvTags, purchaseAuthRequest.emvTags) &&
- Objects.equals(this.pan, purchaseAuthRequest.pan) &&
- Objects.equals(this.uuid, purchaseAuthRequest.uuid);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(emvTags, pan, uuid);
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class PurchaseAuthRequest {\n");
-
- sb.append(" emvTags: ").append(toIndentedString(emvTags)).append("\n");
- sb.append(" pan: ").append(toIndentedString(pan)).append("\n");
- sb.append(" uuid: ").append(toIndentedString(uuid)).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/design-first-swagger-openliberty/src/test/resources/PurchaseAuthResponse.java.txt b/design-first-swagger-openliberty/src/test/resources/PurchaseAuthResponse.java.txt
deleted file mode 100644
index 51ad8e6..0000000
--- a/design-first-swagger-openliberty/src/test/resources/PurchaseAuthResponse.java.txt
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * txproc-design-first-swagger-openliberty
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * OpenAPI spec version: 0.9
- *
- *
- * NOTE: This class is auto generated by the swagger code generator program.
- * https://github.com/swagger-api/swagger-codegen.git
- * Do not edit the class manually.
- */
-
-package ch.schlau.pesche.apidocs.swagger.designfirst.generated.model;
-
-import java.util.Objects;
-import java.util.Arrays;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.v3.oas.annotations.media.Schema;
-/**
- * Response to PurchaseAuthRequest
- */
-@Schema(description = "Response to PurchaseAuthRequest")
-
-public class PurchaseAuthResponse {
- @JsonProperty("approvalCode")
- private String approvalCode = null;
-
- /**
- * Result of the request
- */
- public enum ResultEnum {
- OK("OK"),
- WRONG("WRONG");
-
- private String value;
-
- ResultEnum(String value) {
- this.value = value;
- }
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
- @JsonCreator
- public static ResultEnum fromValue(String text) {
- for (ResultEnum b : ResultEnum.values()) {
- if (String.valueOf(b.value).equals(text)) {
- return b;
- }
- }
- return null;
- }
-
- } @JsonProperty("result")
- private ResultEnum result = null;
-
- public PurchaseAuthResponse approvalCode(String approvalCode) {
- this.approvalCode = approvalCode;
- return this;
- }
-
- /**
- * Code referencing the successful authorization
- * @return approvalCode
- **/
- @Schema(description = "Code referencing the successful authorization")
- public String getApprovalCode() {
- return approvalCode;
- }
-
- public void setApprovalCode(String approvalCode) {
- this.approvalCode = approvalCode;
- }
-
- public PurchaseAuthResponse result(ResultEnum result) {
- this.result = result;
- return this;
- }
-
- /**
- * Result of the request
- * @return result
- **/
- @Schema(description = "Result of the request")
- public ResultEnum getResult() {
- return result;
- }
-
- public void setResult(ResultEnum result) {
- this.result = result;
- }
-
-
- @Override
- public boolean equals(java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- PurchaseAuthResponse purchaseAuthResponse = (PurchaseAuthResponse) o;
- return Objects.equals(this.approvalCode, purchaseAuthResponse.approvalCode) &&
- Objects.equals(this.result, purchaseAuthResponse.result);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(approvalCode, result);
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class PurchaseAuthResponse {\n");
-
- sb.append(" approvalCode: ").append(toIndentedString(approvalCode)).append("\n");
- sb.append(" result: ").append(toIndentedString(result)).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/design-first-swagger-openliberty/src/test/resources/openapi.json b/design-first-swagger-openliberty/src/test/resources/openapi.json
deleted file mode 100644
index 4e1ba12..0000000
--- a/design-first-swagger-openliberty/src/test/resources/openapi.json
+++ /dev/null
@@ -1,179 +0,0 @@
-{
- "openapi": "3.0.0",
- "info": {
- "title": "txproc-design-first-swagger-openliberty",
- "version": "0.9"
- },
- "servers": [
- {
- "url": "http://localhost:8080"
- }
- ],
- "paths": {
- "/api/txproc/pincheck": {
- "post": {
- "summary": "Check the pin",
- "operationId": "pinCheck",
- "requestBody": {
- "description": "PIN Check Request Body",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PinCheckRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "default": {
- "description": "PIN Check Response",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PinCheckResponse"
- }
- }
- }
- }
- }
- }
- },
- "/api/txproc/purchase": {
- "post": {
- "summary": "Authorize a Purchase",
- "operationId": "purchase",
- "requestBody": {
- "description": "Purchase Request Body",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PurchaseAuthRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "default": {
- "description": "Purchase Response",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PurchaseAuthResponse"
- }
- }
- }
- }
- }
- }
- }
- },
- "components": {
- "schemas": {
- "EmvTags": {
- "title": "EmvTags",
- "type": "object",
- "properties": {
- "84": {
- "title": "Dedicated Filename",
- "type": "string",
- "description": "The EMV AID as reported by ICC"
- },
- "9F1A": {
- "type": "string",
- "description": "Terminal Country Code"
- }
- },
- "description": "Collection of EMV tags"
- },
- "Pan": {
- "title": "PAN (Primary Account Number)",
- "type": "object",
- "description": "The number embossed on credit cards",
- "format": "string"
- },
- "PinCheckRequest": {
- "required": [
- "pan",
- "pinBlock",
- "uuid"
- ],
- "type": "object",
- "properties": {
- "pan": {
- "$ref": "#/components/schemas/Pan"
- },
- "pinBlock": {
- "type": "string",
- "description": "Encrypted binary data containing a PIN\n\nFieldcode: C003"
- },
- "uuid": {
- "type": "string",
- "description": "Unique ID of the request",
- "format": "uuid"
- }
- },
- "description": "Request for checking a PIN"
- },
- "PinCheckResponse": {
- "type": "object",
- "properties": {
- "result": {
- "type": "string",
- "description": "Result of the request",
- "enum": [
- "OK",
- "WRONG"
- ]
- },
- "tries": {
- "type": "integer",
- "description": "Number of remaining tries",
- "format": "int32"
- }
- },
- "description": "Tells if the PIN in the request was correct"
- },
- "PurchaseAuthRequest": {
- "required": [
- "pan",
- "uuid"
- ],
- "type": "object",
- "properties": {
- "emvTags": {
- "$ref": "#/components/schemas/EmvTags"
- },
- "pan": {
- "$ref": "#/components/schemas/Pan"
- },
- "uuid": {
- "type": "string",
- "description": "Unique ID of the request",
- "format": "uuid"
- }
- },
- "description": "Request for authorizing a Purchase"
- },
- "PurchaseAuthResponse": {
- "type": "object",
- "properties": {
- "approvalCode": {
- "type": "string",
- "description": "Code referencing the successful authorization"
- },
- "result": {
- "type": "string",
- "description": "Result of the request",
- "enum": [
- "OK",
- "WRONG"
- ]
- }
- },
- "description": "Response to PurchaseAuthRequest"
- }
- }
- }
-}
diff --git a/design-first-swagger-openliberty/src/test/resources/openapi.yaml b/design-first-swagger-openliberty/src/test/resources/openapi.yaml
deleted file mode 100644
index ffe39e5..0000000
--- a/design-first-swagger-openliberty/src/test/resources/openapi.yaml
+++ /dev/null
@@ -1,124 +0,0 @@
-openapi: 3.0.0
-info:
- title: txproc-design-first-swagger-openliberty
- version: "0.9"
-servers:
-- url: http://localhost:8080
-paths:
- /api/txproc/pincheck:
- post:
- summary: Check the pin
- operationId: pinCheck
- requestBody:
- description: PIN Check Request Body
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PinCheckRequest'
- required: true
- responses:
- default:
- description: PIN Check Response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PinCheckResponse'
- /api/txproc/purchase:
- post:
- summary: Authorize a Purchase
- operationId: purchase
- requestBody:
- description: Purchase Request Body
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PurchaseAuthRequest'
- required: true
- responses:
- default:
- description: Purchase Response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PurchaseAuthResponse'
-components:
- schemas:
- EmvTags:
- title: EmvTags
- type: object
- properties:
- 84:
- title: Dedicated Filename
- type: string
- description: The EMV AID as reported by ICC
- 9F1A:
- type: string
- description: Terminal Country Code
- description: Collection of EMV tags
- Pan:
- title: PAN (Primary Account Number)
- type: object
- description: The number embossed on credit cards
- format: string
- PinCheckRequest:
- required:
- - pan
- - pinBlock
- - uuid
- type: object
- properties:
- pan:
- $ref: '#/components/schemas/Pan'
- pinBlock:
- type: string
- description: |-
- Encrypted binary data containing a PIN
-
- Fieldcode: C003
- uuid:
- type: string
- description: Unique ID of the request
- format: uuid
- description: Request for checking a PIN
- PinCheckResponse:
- type: object
- properties:
- result:
- type: string
- description: Result of the request
- enum:
- - OK
- - WRONG
- tries:
- type: integer
- description: Number of remaining tries
- format: int32
- description: Tells if the PIN in the request was correct
- PurchaseAuthRequest:
- required:
- - pan
- - uuid
- type: object
- properties:
- emvTags:
- $ref: '#/components/schemas/EmvTags'
- pan:
- $ref: '#/components/schemas/Pan'
- uuid:
- type: string
- description: Unique ID of the request
- format: uuid
- description: Request for authorizing a Purchase
- PurchaseAuthResponse:
- type: object
- properties:
- approvalCode:
- type: string
- description: Code referencing the successful authorization
- result:
- type: string
- description: Result of the request
- enum:
- - OK
- - WRONG
- description: Response to PurchaseAuthRequest
diff --git a/design-first-swagger-openliberty/src/test/resources/rest-api.http b/design-first-swagger-openliberty/src/test/resources/rest-api.http
deleted file mode 100644
index 6aee14d..0000000
--- a/design-first-swagger-openliberty/src/test/resources/rest-api.http
+++ /dev/null
@@ -1,35 +0,0 @@
-# Swagger/OpenAPI in YAML format
-GET http://localhost:8080/openapi
-
-###
-
-# Swagger/OpenAPI in JSON format
-GET http://localhost:8080/openapi
-Accept: application/json
-
-###
-
-POST http://localhost:8080/api/txproc/pincheck
-Content-Type: application/json
-
-{
- "uuid": "aaaaaaaa-bbbb-cccc-dddd-012345678901",
- "pan" : "100000000042",
- "pinBlock": "magic"
-}
-
-###
-
-POST http://localhost:8080/api/txproc/purchase
-Content-Type: application/json
-
-{
- "uuid": "aaaaaaaa-bbbb-cccc-dddd-012345678901",
- "pan": "4244333322221111",
- "emvTags": {
- "84" : "A0000000041010",
- "9f1A" : "250"
- }
-}
-
-###
diff --git a/design-first-swagger-quarkus/.editorconfig b/design-first-swagger-quarkus/.editorconfig
new file mode 100644
index 0000000..222d8e4
--- /dev/null
+++ b/design-first-swagger-quarkus/.editorconfig
@@ -0,0 +1,19 @@
+# editor configuration containing values that are different from the IntelliJ default
+
+[*]
+charset = utf-8
+indent_size = 4
+indent_style = space
+
+[*.java]
+ij_java_imports_layout = $*, |, java.**, |, jakarta.**, javax.**, |, oracle.**, |, org.**, |, com.**, |, *
+
+[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.rng,*.tld,*.wadl,*.wsdd,*.wsdl,*.xjb,*.xml,*.xsd,*.xsl,*.xslt,*.xul}]
+ij_xml_line_comment_at_first_column = false
+
+[{*.har,*.jsb2,*.jsb3,*.json,*.ndjson,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}]
+indent_size = 2
+
+[{*.yaml,*.yml}]
+indent_size = 2
+ij_yaml_indent_sequence_value = false
diff --git a/design-first-swagger-quarkus/pom.xml b/design-first-swagger-quarkus/pom.xml
index e2e540a..d2503b7 100644
--- a/design-first-swagger-quarkus/pom.xml
+++ b/design-first-swagger-quarkus/pom.xml
@@ -14,23 +14,21 @@
- 11
+ 17
-
- 2.9.9.3
- 1.18.10
- 0.25.0
- 2.0.10
- 3.0.11
+ 1.18.30
+ 3.5.0
+ 2.2.18
+ 3.0.50
2.2
- 2.10.0
+ 3.2.2
- 3.8.1
- 2.22.2
+ 3.11.0
+ 3.2.1
${project.build.directory}/generated-sources/swagger
@@ -48,7 +46,7 @@
-
+
io.quarkus
quarkus-resteasy-jsonb
@@ -59,12 +57,7 @@
-
- com.fasterxml.jackson.core
- jackson-databind
- ${jackson-2-version}
- provided
-
+
io.swagger.core.v3
swagger-annotations
@@ -109,6 +102,13 @@
${json.unit.version}
test
+
+
+
+ io.quarkus
+ quarkus-smallrye-openapi-deployment
+ test
+
@@ -116,7 +116,7 @@
io.swagger.codegen.v3
swagger-codegen-maven-plugin
- ${swagger.codegen.version}
+ ${swagger-codegen.plugin.version}
@@ -138,12 +138,13 @@
.
ch.schlau.pesche.apidocs.swagger.designfirst.generated.model
-
- hideGenerationTimestamp=true
+
+ hideGenerationTimestamp=true
+ jakarta=true
- Pan=ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan
+ Pan=ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan
@@ -168,6 +169,13 @@
${java.release}
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+
+
@@ -175,10 +183,10 @@
maven-surefire-plugin
${maven.surefire.plugin.version}
-
+
org.jboss.logmanager.LogManager
${generated.path}
-
+
**/*Test.java
diff --git a/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JaxrsApplication.java b/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JaxrsApplication.java
index cffd174..8d9146d 100644
--- a/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JaxrsApplication.java
+++ b/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JaxrsApplication.java
@@ -1,7 +1,7 @@
package ch.schlau.pesche.apidocs.swagger.designfirst.rest;
-import javax.ws.rs.ApplicationPath;
-import javax.ws.rs.core.Application;
+import jakarta.ws.rs.ApplicationPath;
+import jakarta.ws.rs.core.Application;
@ApplicationPath("/api")
public class JaxrsApplication extends Application {
diff --git a/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonConfiguration.java b/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonConfiguration.java
index 4a1acc5..8a25774 100644
--- a/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonConfiguration.java
+++ b/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonConfiguration.java
@@ -1,8 +1,8 @@
package ch.schlau.pesche.apidocs.swagger.designfirst.rest;
-import javax.json.bind.Jsonb;
-import javax.json.bind.JsonbBuilder;
-import javax.json.bind.JsonbConfig;
+import jakarta.json.bind.Jsonb;
+import jakarta.json.bind.JsonbBuilder;
+import jakarta.json.bind.JsonbConfig;
import ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.PanJsonAdapter;
import lombok.experimental.UtilityClass;
diff --git a/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonContextResolver.java b/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonContextResolver.java
index fc3df3f..ee56569 100644
--- a/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonContextResolver.java
+++ b/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/JsonContextResolver.java
@@ -2,9 +2,9 @@
import static ch.schlau.pesche.apidocs.swagger.designfirst.rest.JsonConfiguration.JSONB;
-import javax.json.bind.Jsonb;
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.Provider;
+import jakarta.json.bind.Jsonb;
+import jakarta.ws.rs.ext.ContextResolver;
+import jakarta.ws.rs.ext.Provider;
@Provider
public class JsonContextResolver implements ContextResolver {
diff --git a/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProc.java b/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProc.java
index 828df91..e7785d0 100644
--- a/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProc.java
+++ b/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProc.java
@@ -2,11 +2,11 @@
import java.util.Optional;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.EmvTags;
import ch.schlau.pesche.apidocs.swagger.designfirst.generated.model.PinCheckRequest;
diff --git a/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/Pan.java b/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/Pan.java
index 40637b4..784d1d0 100644
--- a/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/Pan.java
+++ b/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/Pan.java
@@ -1,6 +1,6 @@
package ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model;
-import javax.validation.constraints.Pattern;
+import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Getter;
diff --git a/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanJsonAdapter.java b/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanJsonAdapter.java
index 14f9c51..a7eadfa 100644
--- a/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanJsonAdapter.java
+++ b/design-first-swagger-quarkus/src/main/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanJsonAdapter.java
@@ -1,6 +1,6 @@
package ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model;
-import javax.json.bind.adapter.JsonbAdapter;
+import jakarta.json.bind.adapter.JsonbAdapter;
public class PanJsonAdapter implements JsonbAdapter {
@Override
diff --git a/design-first-swagger-quarkus/src/main/resources/META-INF/microprofile-config.properties b/design-first-swagger-quarkus/src/main/resources/META-INF/microprofile-config.properties
index ac79149..fbdbd0a 100644
--- a/design-first-swagger-quarkus/src/main/resources/META-INF/microprofile-config.properties
+++ b/design-first-swagger-quarkus/src/main/resources/META-INF/microprofile-config.properties
@@ -1,2 +1,6 @@
# the OpenAPI document is provided as source (design-first), no annotation scan needed
mp.openapi.scan.disable = true
+
+# keep /openapi instead /q/openapi for the time being
+# see https://quarkus.io/blog/path-resolution-in-quarkus/
+quarkus.http.non-application-root-path=${quarkus.http.root-path}
diff --git a/design-first-swagger-quarkus/src/main/resources/META-INF/openapi.yaml b/design-first-swagger-quarkus/src/main/resources/META-INF/openapi.yaml
index d053327..5495ed1 100644
--- a/design-first-swagger-quarkus/src/main/resources/META-INF/openapi.yaml
+++ b/design-first-swagger-quarkus/src/main/resources/META-INF/openapi.yaml
@@ -1,9 +1,9 @@
-openapi: 3.0.0
+openapi: 3.0.3
info:
title: txproc-design-first-swagger
version: "0.9"
servers:
- - url: http://localhost:8080
+- url: http://localhost:8080
paths:
/api/txproc/pincheck:
post:
diff --git a/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/OpenapiDocumentIT.java b/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/OpenapiDocumentIT.java
index 19259c5..3e1573b 100644
--- a/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/OpenapiDocumentIT.java
+++ b/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/OpenapiDocumentIT.java
@@ -11,7 +11,7 @@
import java.io.IOException;
import java.nio.charset.StandardCharsets;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MediaType;
import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.Test;
@@ -44,8 +44,8 @@ static class OpenapiSkeleton {
@Test
void openapi_yaml() throws IOException {
- String expected = loadResourceFile("openapi.yaml");
- String expectedSorted = loadResourceFile("openapi-sorted.yaml");
+ String expected = loadResourceFile("openapi.yaml.txt");
+ String expectedSorted = loadResourceFile("openapi-sorted.yaml.txt");
String document = when().get("/openapi")
.then()
@@ -63,7 +63,7 @@ void openapi_yaml() throws IOException {
@Test
void openapi_json() throws IOException {
- String expected = loadResourceFile("openapi.json");
+ String expected = loadResourceFile("openapi.json.txt");
String document = given().accept(MediaType.APPLICATION_JSON)
.when().get("/openapi")
@@ -72,7 +72,7 @@ void openapi_json() throws IOException {
.assertThat().contentType(MediaType.APPLICATION_JSON)
.extract().response().asString();
- assertThat(document, jsonEquals(expected));
+ assertThat("actual: " + document, document, jsonEquals(expected));
}
private String sortYaml(String yaml) throws IOException {
diff --git a/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPincheckIT.java b/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPincheckIT.java
index af09820..62c4942 100644
--- a/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPincheckIT.java
+++ b/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPincheckIT.java
@@ -3,7 +3,7 @@
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MediaType;
import org.junit.jupiter.api.Test;
diff --git a/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPurchaseIT.java b/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPurchaseIT.java
index e7ba07c..d61caa2 100644
--- a/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPurchaseIT.java
+++ b/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/rest/TxProcPurchaseIT.java
@@ -3,7 +3,7 @@
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MediaType;
import org.junit.jupiter.api.Test;
diff --git a/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanTest.java b/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanTest.java
index a4f118b..1fb5111 100644
--- a/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanTest.java
+++ b/design-first-swagger-quarkus/src/test/java/ch/schlau/pesche/apidocs/swagger/designfirst/txproc/model/PanTest.java
@@ -5,7 +5,7 @@
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
-import javax.json.bind.Jsonb;
+import jakarta.json.bind.Jsonb;
import org.junit.jupiter.api.Test;
diff --git a/design-first-swagger-quarkus/src/test/resources/EmvTags.java.txt b/design-first-swagger-quarkus/src/test/resources/EmvTags.java.txt
index c9f21e7..fae201c 100644
--- a/design-first-swagger-quarkus/src/test/resources/EmvTags.java.txt
+++ b/design-first-swagger-quarkus/src/test/resources/EmvTags.java.txt
@@ -23,6 +23,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
*/
@Schema(description = "Collection of EMV tags")
+
public class EmvTags {
@JsonProperty("84")
private String _84 = null;
diff --git a/design-first-swagger-quarkus/src/test/resources/PinCheckRequest.java.txt b/design-first-swagger-quarkus/src/test/resources/PinCheckRequest.java.txt
index 326102d..f779ac5 100644
--- a/design-first-swagger-quarkus/src/test/resources/PinCheckRequest.java.txt
+++ b/design-first-swagger-quarkus/src/test/resources/PinCheckRequest.java.txt
@@ -24,6 +24,7 @@ import java.util.UUID;
*/
@Schema(description = "Request for checking a PIN")
+
public class PinCheckRequest {
@JsonProperty("pan")
private ch.schlau.pesche.apidocs.swagger.designfirst.txproc.model.Pan pan = null;
diff --git a/design-first-swagger-quarkus/src/test/resources/PinCheckResponse.java.txt b/design-first-swagger-quarkus/src/test/resources/PinCheckResponse.java.txt
index 5e034a9..3c58f3e 100644
--- a/design-first-swagger-quarkus/src/test/resources/PinCheckResponse.java.txt
+++ b/design-first-swagger-quarkus/src/test/resources/PinCheckResponse.java.txt
@@ -23,6 +23,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
*/
@Schema(description = "Tells if the PIN in the request was correct")
+
public class PinCheckResponse {
/**
* Result of the request
@@ -46,9 +47,9 @@ public class PinCheckResponse {
return String.valueOf(value);
}
@JsonCreator
- public static ResultEnum fromValue(String text) {
+ public static ResultEnum fromValue(String input) {
for (ResultEnum b : ResultEnum.values()) {
- if (String.valueOf(b.value).equals(text)) {
+ if (b.value.equals(input)) {
return b;
}
}
diff --git a/design-first-swagger-quarkus/src/test/resources/PurchaseAuthRequest.java.txt b/design-first-swagger-quarkus/src/test/resources/PurchaseAuthRequest.java.txt
index 15c0ca3..a355728 100644
--- a/design-first-swagger-quarkus/src/test/resources/PurchaseAuthRequest.java.txt
+++ b/design-first-swagger-quarkus/src/test/resources/PurchaseAuthRequest.java.txt
@@ -25,6 +25,7 @@ import java.util.UUID;
*/
@Schema(description = "Request for authorizing a Purchase")
+
public class PurchaseAuthRequest {
@JsonProperty("emvTags")
private EmvTags emvTags = null;
diff --git a/design-first-swagger-quarkus/src/test/resources/PurchaseAuthResponse.java.txt b/design-first-swagger-quarkus/src/test/resources/PurchaseAuthResponse.java.txt
index 10d855a..49a52f6 100644
--- a/design-first-swagger-quarkus/src/test/resources/PurchaseAuthResponse.java.txt
+++ b/design-first-swagger-quarkus/src/test/resources/PurchaseAuthResponse.java.txt
@@ -23,6 +23,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
*/
@Schema(description = "Response to PurchaseAuthRequest")
+
public class PurchaseAuthResponse {
@JsonProperty("approvalCode")
private String approvalCode = null;
@@ -49,9 +50,9 @@ public class PurchaseAuthResponse {
return String.valueOf(value);
}
@JsonCreator
- public static ResultEnum fromValue(String text) {
+ public static ResultEnum fromValue(String input) {
for (ResultEnum b : ResultEnum.values()) {
- if (String.valueOf(b.value).equals(text)) {
+ if (b.value.equals(input)) {
return b;
}
}
diff --git a/design-first-swagger-quarkus/src/test/resources/openapi-sorted.yaml b/design-first-swagger-quarkus/src/test/resources/openapi-sorted.yaml.txt
similarity index 98%
rename from design-first-swagger-quarkus/src/test/resources/openapi-sorted.yaml
rename to design-first-swagger-quarkus/src/test/resources/openapi-sorted.yaml.txt
index 6959387..b44e3d6 100644
--- a/design-first-swagger-quarkus/src/test/resources/openapi-sorted.yaml
+++ b/design-first-swagger-quarkus/src/test/resources/openapi-sorted.yaml.txt
@@ -1,5 +1,5 @@
---
-openapi: 3.0.0
+openapi: 3.0.3
info:
title: txproc-design-first-swagger
version: 0.9
@@ -47,11 +47,11 @@ components:
EmvTags:
description: Collection of EMV tags
properties:
- 84:
+ "84":
description: The EMV AID as reported by ICC
title: Dedicated Filename
type: string
- 9F1A:
+ "9F1A":
description: Terminal Country Code
type: string
title: EmvTags
diff --git a/design-first-swagger-quarkus/src/test/resources/openapi.json b/design-first-swagger-quarkus/src/test/resources/openapi.json
deleted file mode 100644
index 88e160f..0000000
--- a/design-first-swagger-quarkus/src/test/resources/openapi.json
+++ /dev/null
@@ -1,179 +0,0 @@
-{
- "openapi": "3.0.0",
- "info": {
- "title": "txproc-design-first-swagger",
- "version": "0.9"
- },
- "servers": [
- {
- "url": "http://localhost:8080"
- }
- ],
- "paths": {
- "/api/txproc/pincheck": {
- "post": {
- "summary": "Check the pin",
- "operationId": "pinCheck",
- "requestBody": {
- "description": "PIN Check Request Body",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PinCheckRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "default": {
- "description": "PIN Check Response",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PinCheckResponse"
- }
- }
- }
- }
- }
- }
- },
- "/api/txproc/purchase": {
- "post": {
- "summary": "Authorize a Purchase",
- "operationId": "purchase",
- "requestBody": {
- "description": "Purchase Request Body",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PurchaseAuthRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "default": {
- "description": "Purchase Response",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PurchaseAuthResponse"
- }
- }
- }
- }
- }
- }
- }
- },
- "components": {
- "schemas": {
- "EmvTags": {
- "title": "EmvTags",
- "description": "Collection of EMV tags",
- "type": "object",
- "properties": {
- "84": {
- "title": "Dedicated Filename",
- "description": "The EMV AID as reported by ICC",
- "type": "string"
- },
- "9F1A": {
- "description": "Terminal Country Code",
- "type": "string"
- }
- }
- },
- "Pan": {
- "format": "string",
- "title": "PAN (Primary Account Number)",
- "description": "The number embossed on credit cards",
- "type": "object"
- },
- "PinCheckRequest": {
- "description": "Request for checking a PIN",
- "required": [
- "pan",
- "pinBlock",
- "uuid"
- ],
- "type": "object",
- "properties": {
- "pan": {
- "$ref": "#/components/schemas/Pan"
- },
- "pinBlock": {
- "description": "Encrypted binary data containing a PIN\n\nFieldcode: C003",
- "type": "string"
- },
- "uuid": {
- "format": "uuid",
- "description": "Unique ID of the request",
- "type": "string"
- }
- }
- },
- "PinCheckResponse": {
- "description": "Tells if the PIN in the request was correct",
- "type": "object",
- "properties": {
- "result": {
- "description": "Result of the request",
- "enum": [
- "OK",
- "WRONG"
- ],
- "type": "string"
- },
- "tries": {
- "format": "int32",
- "description": "Number of remaining tries",
- "type": "integer"
- }
- }
- },
- "PurchaseAuthRequest": {
- "description": "Request for authorizing a Purchase",
- "required": [
- "pan",
- "uuid"
- ],
- "type": "object",
- "properties": {
- "emvTags": {
- "$ref": "#/components/schemas/EmvTags"
- },
- "pan": {
- "$ref": "#/components/schemas/Pan"
- },
- "uuid": {
- "format": "uuid",
- "description": "Unique ID of the request",
- "type": "string"
- }
- }
- },
- "PurchaseAuthResponse": {
- "description": "Response to PurchaseAuthRequest",
- "type": "object",
- "properties": {
- "approvalCode": {
- "description": "Code referencing the successful authorization",
- "type": "string"
- },
- "result": {
- "description": "Result of the request",
- "enum": [
- "OK",
- "WRONG"
- ],
- "type": "string"
- }
- }
- }
- }
- }
-}
diff --git a/design-first-swagger-quarkus/src/test/resources/openapi.json.txt b/design-first-swagger-quarkus/src/test/resources/openapi.json.txt
new file mode 100644
index 0000000..16adff0
--- /dev/null
+++ b/design-first-swagger-quarkus/src/test/resources/openapi.json.txt
@@ -0,0 +1,164 @@
+{
+ "openapi" : "3.0.3",
+ "info" : {
+ "title" : "txproc-design-first-swagger",
+ "version" : "0.9"
+ },
+ "servers" : [ {
+ "url" : "http://localhost:8080"
+ } ],
+ "paths" : {
+ "/api/txproc/pincheck" : {
+ "post" : {
+ "summary" : "Check the pin",
+ "operationId" : "pinCheck",
+ "requestBody" : {
+ "description" : "PIN Check Request Body",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PinCheckRequest"
+ }
+ }
+ },
+ "required" : true
+ },
+ "responses" : {
+ "default" : {
+ "description" : "PIN Check Response",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PinCheckResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/txproc/purchase" : {
+ "post" : {
+ "summary" : "Authorize a Purchase",
+ "operationId" : "purchase",
+ "requestBody" : {
+ "description" : "Purchase Request Body",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PurchaseAuthRequest"
+ }
+ }
+ },
+ "required" : true
+ },
+ "responses" : {
+ "default" : {
+ "description" : "Purchase Response",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PurchaseAuthResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components" : {
+ "schemas" : {
+ "EmvTags" : {
+ "title" : "EmvTags",
+ "description" : "Collection of EMV tags",
+ "type" : "object",
+ "properties" : {
+ "84" : {
+ "title" : "Dedicated Filename",
+ "description" : "The EMV AID as reported by ICC",
+ "type" : "string"
+ },
+ "9F1A" : {
+ "description" : "Terminal Country Code",
+ "type" : "string"
+ }
+ }
+ },
+ "Pan" : {
+ "format" : "string",
+ "title" : "PAN (Primary Account Number)",
+ "description" : "The number embossed on credit cards",
+ "type" : "object"
+ },
+ "PinCheckRequest" : {
+ "description" : "Request for checking a PIN",
+ "required" : [ "pan", "pinBlock", "uuid" ],
+ "type" : "object",
+ "properties" : {
+ "pan" : {
+ "$ref" : "#/components/schemas/Pan"
+ },
+ "pinBlock" : {
+ "description" : "Encrypted binary data containing a PIN\n\nFieldcode: C003",
+ "type" : "string"
+ },
+ "uuid" : {
+ "format" : "uuid",
+ "description" : "Unique ID of the request",
+ "type" : "string"
+ }
+ }
+ },
+ "PinCheckResponse" : {
+ "description" : "Tells if the PIN in the request was correct",
+ "type" : "object",
+ "properties" : {
+ "result" : {
+ "description" : "Result of the request",
+ "enum" : [ "OK", "WRONG" ],
+ "type" : "string"
+ },
+ "tries" : {
+ "format" : "int32",
+ "description" : "Number of remaining tries",
+ "type" : "integer"
+ }
+ }
+ },
+ "PurchaseAuthRequest" : {
+ "description" : "Request for authorizing a Purchase",
+ "required" : [ "pan", "uuid" ],
+ "type" : "object",
+ "properties" : {
+ "emvTags" : {
+ "$ref" : "#/components/schemas/EmvTags"
+ },
+ "pan" : {
+ "$ref" : "#/components/schemas/Pan"
+ },
+ "uuid" : {
+ "format" : "uuid",
+ "description" : "Unique ID of the request",
+ "type" : "string"
+ }
+ }
+ },
+ "PurchaseAuthResponse" : {
+ "description" : "Response to PurchaseAuthRequest",
+ "type" : "object",
+ "properties" : {
+ "approvalCode" : {
+ "description" : "Code referencing the successful authorization",
+ "type" : "string"
+ },
+ "result" : {
+ "description" : "Result of the request",
+ "enum" : [ "OK", "WRONG" ],
+ "type" : "string"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/design-first-swagger-quarkus/src/test/resources/openapi.yaml b/design-first-swagger-quarkus/src/test/resources/openapi.yaml.txt
similarity index 98%
rename from design-first-swagger-quarkus/src/test/resources/openapi.yaml
rename to design-first-swagger-quarkus/src/test/resources/openapi.yaml.txt
index 1b7ee60..4c7e4d5 100644
--- a/design-first-swagger-quarkus/src/test/resources/openapi.yaml
+++ b/design-first-swagger-quarkus/src/test/resources/openapi.yaml.txt
@@ -1,5 +1,5 @@
---
-openapi: 3.0.0
+openapi: 3.0.3
info:
title: txproc-design-first-swagger
version: "0.9"
@@ -49,11 +49,11 @@ components:
description: Collection of EMV tags
type: object
properties:
- 84:
+ "84":
title: Dedicated Filename
description: The EMV AID as reported by ICC
type: string
- 9F1A:
+ "9F1A":
description: Terminal Country Code
type: string
Pan:
diff --git a/pom.xml b/pom.xml
index ade5e8c..8ab7009 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,11 +10,9 @@
pom
- code-first-openapi-openliberty
code-first-openapi-quarkus
code-first-swagger
design-first-openapi-generator
design-first-swagger-quarkus
- design-first-swagger-openliberty