diff --git a/README.md b/README.md index 7385f3e5a..352e159f8 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,14 @@ The project is very much Work In Progress and will be published on maven central # Release Notes BOAT is still under development and subject to change. +## 0.14.6 +* *Maven Plugin* + * Added `boat:ship` mojo to automagically zip specs found in `src/main/resources` and attach it to the project reactor so `mvn install` or `mvn deploy` will also include a zip archive of the project with with `api` classifier + * Changed `boat:bundle` `includes` parameter to an array of patterns to allow recursive patters to discover OpenAPIs +* *Boat Scaffold* + * Fixed bug in typescript generator where only one of the overloaded function signatures per deprecated endpoint was marked as deprecated. + + ## 0.14.5 * *Boat Marina* * Added `boat-markers` directory in target to keep track of successful and unsuccessful actions on OpenAPI specs diff --git a/boat-engine/pom.xml b/boat-engine/pom.xml index d58bb9e3b..6127d3b31 100644 --- a/boat-engine/pom.xml +++ b/boat-engine/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.14.5 + 0.14.6-SNAPSHOT boat-engine jar diff --git a/boat-maven-plugin/pom.xml b/boat-maven-plugin/pom.xml index 979c98a9b..9e0eb15bf 100644 --- a/boat-maven-plugin/pom.xml +++ b/boat-maven-plugin/pom.xml @@ -6,7 +6,7 @@ com.backbase.oss backbase-openapi-tools - 0.14.5 + 0.14.6-SNAPSHOT boat-maven-plugin @@ -27,6 +27,12 @@ ${project.basedir}/target/jacoco-it.exec + + + + + + @@ -69,7 +75,7 @@ org.apache.maven.shared maven-artifact-transfer - 0.12.0 + 0.13.1 @@ -77,16 +83,17 @@ maven-common-artifact-filters + + org.codehaus.plexus + plexus-archiver + 4.2.5 + + org.sonatype.plexus plexus-build-api 0.0.7 - - org.codehaus.plexus - plexus-io - 3.2.0 - org.apache.maven @@ -136,7 +143,6 @@ test - @@ -155,8 +161,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 + 11 + 11 @@ -171,7 +177,7 @@ unpack-dependencies - ${project.build.outputDirectory} + ${project.build.directory} openapi-generator-maven-plugin diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/pom.xml b/boat-maven-plugin/src/it/example/boat-bundle-ship/pom.xml new file mode 100644 index 000000000..6cafb99c2 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + + + com.backbase.oss.boat.example + example + 1.0.0-SNAPSHOT + + + boat-bundle-ship + 1.0.0-SNAPSHOT + + BOAT :: Bundle Ship Example + + + + + com.backbase.oss + boat-maven-plugin + + + bundle + generate-resources + + bundle + + + + ship + package + + ship + + + ${project.build.directory}/openapi + + + + + + + + + diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/assembly/build.xml b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/assembly/build.xml new file mode 100644 index 000000000..8a0b62203 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/assembly/build.xml @@ -0,0 +1,18 @@ + + api + + zip + + false + + + src/main/resources/ + ${artifactId} + + **/** + + + + \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-request-2.json b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-request-2.json new file mode 100644 index 000000000..8ac179512 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-request-2.json @@ -0,0 +1,4 @@ +{ + "name": "Robin", + "role": "Intern" +} \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-request.json b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-request.json new file mode 100644 index 000000000..9d81e0e32 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-request.json @@ -0,0 +1,4 @@ +{ + "name": "Alex", + "role": "Manager" +} \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-response-2.json b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-response-2.json new file mode 100644 index 000000000..b2f84c1f5 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-response-2.json @@ -0,0 +1,6 @@ +{ + "id": "85494da1-2332-4a42-9a1a-a6534be2bce0", + "name": "Robin", + "role": "Intern", + "rank": 2 +} \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-response.json b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-response.json new file mode 100644 index 000000000..41328b4ac --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-response.json @@ -0,0 +1,7 @@ +{ + "id": "11bd3ca6-5a26-4d97-a3f1-c59df4d6c02f", + "name": "Alex", + "role": "Manager", + "rank": 12, + "optional-param": "012" +} \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-response.xml b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-response.xml new file mode 100644 index 000000000..5959cfb46 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/examples/user-post-response.xml @@ -0,0 +1,7 @@ + + 11bd3ca6-5a26-4d97-a3f1-c59df4d6c02f + Alex + Manager + 12 + 012 + \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/lib/examples/bad-request-validation-error.json b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/lib/examples/bad-request-validation-error.json new file mode 100644 index 000000000..f61ad41f5 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/lib/examples/bad-request-validation-error.json @@ -0,0 +1,13 @@ +{ + "message": "Bad Request", + "errors": [ + { + "message": "Value Exceeded. Must be between {min} and {max}.", + "key": "common.api.shoe-size", + "context": { + "max": "50", + "min": "1" + } + } + ] +} diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/lib/schema/bad-request-error.yaml b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/lib/schema/bad-request-error.yaml new file mode 100644 index 000000000..0f91f0366 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/lib/schema/bad-request-error.yaml @@ -0,0 +1,13 @@ +title: BadRequestError +type: object +properties: + message: + description: Any further information + type: string + errors: + description: Detailed error information + type: array + items: + $ref: error-item.yaml +required: + - message diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/lib/schema/error-item.yaml b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/lib/schema/error-item.yaml new file mode 100644 index 000000000..e3d74c81b --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/lib/schema/error-item.yaml @@ -0,0 +1,16 @@ +title: ErrorItem +type: object +properties: + message: + description: Any further information. + type: string + key: + description: '{capability-name}.api.{api-key-name}. For generated validation + errors this is the path in the document the error resolves to. e.g. object + name + ''.'' + field' + type: string + context: + description: Context can be anything used to construct localised messages. + type: object + additionalProperties: + type: string diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/openapi.yaml new file mode 100644 index 000000000..71c4cb20c --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/openapi.yaml @@ -0,0 +1,176 @@ +openapi: 3.0.3 +info: + title: Exampled API + description: No description available + version: v1 +servers: + - url: /serviceName/client-api/v1 + description: The server +tags: + - name: examples +paths: + /users: + summary: Requests and responses have a singe example - 'all' operations + get: + summary: Get, does not support request body. + responses: + '200': + description: A user object. + content: + application/json: + schema: + $ref: '#/components/schemas/UserPostResponse' + example: + $ref: ./examples/user-post-response.json + post: + summary: Single example + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserPostRequest' + example: + $ref: ./examples/user-post-request.json + responses: + '200': + description: A user object. + content: + application/json: + schema: + $ref: '#/components/schemas/UserPostResponse' + example: + $ref: ./examples/user-post-response.json + '400': + $ref: ./schemas/components.yaml#/components/schemas/BadRequestResponse + put: + summary: Single example + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserPostRequest' + example: + $ref: ./examples/user-post-request.json + responses: + '200': + description: A user object. + content: + application/json: + schema: + $ref: '#/components/schemas/UserPostResponse' + example: + $ref: ./examples/user-post-response.json + '400': + description: Fixing an invalid example reference + content: + application/json: + schema: + $ref: ./lib/schema/bad-request-error.yaml + example: + value: + $ref: ./examples/user-post-response.json + '401': + description: Fixing an invalid example reference + content: + application/json: + schema: + $ref: ./lib/schema/bad-request-error.yaml + examples: + named-bad-example: + value: + $ref: ./examples/user-post-response.json + patch: + summary: Single example + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserPostRequest' + example: + $ref: ./examples/user-post-request.json + responses: + '200': + description: A user object. + content: + application/json: + schema: + $ref: '#/components/schemas/UserPostResponse' + example: + $ref: ./examples/user-post-response.json + /multi-users: + summary: An endpoint that has multiple examples for both request and response bodies. Also, multiple media types + post: + summary: Multiple examples + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserPostRequest' + examples: + example-number-one: + $ref: ./examples/user-post-request.json + example-number-two: + $ref: ./examples/user-post-request-2.json + responses: + '200': + description: A user object. + content: + application/json: + schema: + $ref: '#/components/schemas/UserPostResponse' + examples: + example-number-one: + $ref: ./examples/user-post-response.json + example-number-two: + $ref: ./examples/user-post-response-2.json + application/xml: + schema: + $ref: '#/components/schemas/UserPostResponse' + examples: + example-number-one: + $ref: ./examples/user-post-response.xml + /example-in-component: + post: + summary: Examples in schema cannot contain a ref + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WithExampleRequest' + responses: + '200': + description: A user object. + content: + application/json: + schema: + $ref: '#/components/schemas/WithExampleResponse' + examples: + in-component: + $ref: '#/components/examples/example-in-components' + in-component-1: + $ref: '#/components/examples/example-in-components-1' +components: + schemas: + UserPostRequest: + $ref: 'schemas/post-user-request.json' + UserPostResponse: + $ref: 'schemas/post-user-response.json' + WithExampleRequest: + $ref: 'schemas/post-user-request.json' + example: + name: "Eddie" + rank: 99 + WithExampleResponse: + $ref: 'schemas/post-user-response.json' + examples: + example-in-components: + $ref: ./examples/user-post-response.json + example-in-components-1: + summary: component-examples with example - should be left alone + value: + id: "1" + name: "Michel" + rank: 22 + example-number-one: + summary: component-examples with reference, matching the name of a path examples - also, summary ignored. + $ref: ./examples/user-post-request.json diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/schemas/components.yaml b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/schemas/components.yaml new file mode 100644 index 000000000..f8e469740 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/schemas/components.yaml @@ -0,0 +1,11 @@ +openapi: 3.0.3 +components: + schemas: + BadRequestResponse: + description: Bad request response + content: + application/json: + schema: + $ref: '../lib/schema/bad-request-error.yaml' + example: + $ref: '../lib/examples/bad-request-validation-error.json' diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/schemas/post-user-request.json b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/schemas/post-user-request.json new file mode 100644 index 000000000..6238c837b --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/schemas/post-user-request.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "description": "this models a simple item.", + "properties": { + "name": { + "name": "string" + }, + "description": { + "role": "string" + } + }, + "required": [ + "name" + ] +} diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/schemas/post-user-response.json b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/schemas/post-user-response.json new file mode 100644 index 000000000..eb825cebb --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/bundler-examples-test-api/schemas/post-user-response.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "description": "this models a simple item.", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "rank": { + "type": "integer" + }, + "optional-param": { + "type": "string" + } + }, + "required": [ + "name" + ] +} diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-client-api/index.html b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-client-api/index.html new file mode 100644 index 000000000..80aa61995 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-client-api/index.html @@ -0,0 +1,24 @@ + + + + Wallet Test Client API + + + + + + + + + + + + + \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-client-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-client-api/openapi.yaml new file mode 100644 index 000000000..2afbf798f --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-client-api/openapi.yaml @@ -0,0 +1,1503 @@ +openapi: 3.0.1 +info: + title: Wallet Test Client API + description: No description available + version: v1 +servers: +- url: /serviceName/client-api/v1 + description: The server +tags: +- name: wallet test client api +paths: + /wallet/paymentcards: + summary: Payment Cards + description: No description available + get: + tags: + - wallet + summary: Returns available payment card details for user, optionally filtered + by nameOnCard. + description: Returns available payment card details for user, optionally filtered + by nameOnCard + operationId: getPaymentcards + parameters: + - name: nameOnCard + in: query + description: Filter by the cardholder's name (case-insensitive), can be the + first one or more characters of one of the words/names + required: false + schema: + type: string + examples: + example: + summary: example + value: Smi + - name: dateTimeOnly + in: query + description: Creation date in datetime-only format + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 2017-10-04T14:54:36 + - name: dateTime + in: query + description: Creation date in Zoned RFC3339 Date-time format + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 2017-10-04T14:54:36Z + - name: dateTime2616 + in: query + description: Zoned RFC2616 Date-time param example + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: Wed, 4 Jul 2001 12:08:56 PDT + - name: date + in: query + description: Date-only param example + required: false + schema: + type: string + format: date + examples: + example: + summary: example + value: 2017-10-04 + - name: time + in: query + description: time-only param example + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 14:54:36 + - name: orderBy + in: query + description: | + Order by field: nameOnCard + required: false + schema: + type: string + examples: + example: + summary: example + - name: direction + in: query + description: Direction + required: false + schema: + type: string + enum: + - ASC + - DESC + default: DESC + examples: + example: + summary: example + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCards' + examples: + example: + value: |- + [ { + "id" : "a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1", + "pan" : "5434111122223333", + "cvc" : "123", + "startDate" : "0116", + "expiryDate" : "1219", + "nameOnCard" : "Mr Timmy Tester", + "creationDate" : "2011-05-30T12:13:14+03:00", + "balance" : { + "amount" : "2001", + "currencyCode" : "EUR" + }, + "apr" : 12.75 + }, { + "id" : "d593c212-70ad-41a6-a547-d5d9232414cb", + "pan" : "5434111122224444", + "cvc" : "101", + "startDate" : "0216", + "expiryDate" : "0120", + "nameOnCard" : "Mr Timmothy Tester", + "creationDate" : "2011-05-30T12:13:14+03:00", + "balance" : { + "amount" : "4.4399999999999995", + "currencyCode" : "GBP" + }, + "apr" : 12.75 + }, { + "id" : "9635966b-28e9-4479-8121-bb7bc9beeb62", + "pan" : "5434121212121212", + "cvc" : "121", + "startDate" : "0115", + "expiryDate" : "1218", + "nameOnCard" : "Mr Timmy Tester", + "creationDate" : "2011-05-30T12:13:14+03:00", + "balance" : { + "amount" : "1981", + "currencyCode" : "EUR" + }, + "apr" : 12.75 + } ] + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: |- + { + "message" : "Bad Request", + "errors" : [ { + "message" : "Value Exceeded. Must be between {min} and {max}.", + "key" : "common.api.shoesize", + "context" : { + "max" : "50", + "min" : "1" + } + } ] + } + "406": + description: NotAcceptable + content: + application/json: + schema: + $ref: '#/components/schemas/NotAcceptableError' + examples: + example: + value: |- + { + "message" : "Could not find acceptable representation", + "supportedMediaTypes" : [ "application/json" ] + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to an insufficient user quota of {quota}.", + "key" : "common.api.quota", + "context" : { + "quota" : "someQuota" + } + } ] + } + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: |- + { + "message" : "Unsupported media type.", + "errors" : [ { + "message" : "The request entity has a media type {mediaType} which the resource does not support.", + "key" : "common.api.mediaType", + "context" : { + "mediaType" : "application/javascript" + } + } ] + } + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: |- + { + "message" : "Resource not found.", + "errors" : [ { + "message" : "Unable to find the resource requested resource: {resource}.", + "key" : "common.api.resource", + "context" : { + "resource" : "aResource" + } + } ] + } + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to invalid credentials.", + "key" : "common.api.token", + "context" : { + "accessToken" : "expired" + } + } ] + } + x-BbAccessControl-resource: WALLET + x-BbAccessControl-function: MANAGE_PAYMENT_CARDS + x-BbAccessControl-privilege: READ_PAYMENT_CARD + post: + tags: + - wallet + summary: Adds a payment card to the user's wallet. + description: Adds a payment card to the user's wallet + operationId: postPaymentcards + parameters: + - name: X-Request-Id + in: header + description: Correlates HTTP requests between a client and server. + required: false + schema: + type: string + examples: + example: + summary: example + value: f058ebd6-02f7-4d3f-942e-904344e8cde5 + requestBody: + description: Adds a payment card to the user's wallet + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCard' + examples: + example: + value: |- + { + "id" : "a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1", + "pan" : "5434111122223333", + "cvc" : "123", + "startDate" : "0116", + "expiryDate" : "1219", + "nameOnCard" : "Mr Timmy Tester", + "creationDate" : "2011-05-30T12:13:14+03:00", + "balance" : { + "amount" : "1000", + "currencyCode" : "EUR" + }, + "apr" : 12.75 + } + responses: + "201": + description: request to create payment card accepted + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCardsPostResponseBody' + examples: + example: + value: |- + { + "id" : "a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1" + } + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: |- + { + "message" : "Bad Request", + "errors" : [ { + "message" : "Value Exceeded. Must be between {min} and {max}.", + "key" : "common.api.shoesize", + "context" : { + "max" : "50", + "min" : "1" + } + } ] + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to an insufficient user quota of {quota}.", + "key" : "common.api.quota", + "context" : { + "quota" : "someQuota" + } + } ] + } + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: |- + { + "message" : "Unsupported media type.", + "errors" : [ { + "message" : "The request entity has a media type {mediaType} which the resource does not support.", + "key" : "common.api.mediaType", + "context" : { + "mediaType" : "application/javascript" + } + } ] + } + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: |- + { + "message" : "Resource not found.", + "errors" : [ { + "message" : "Unable to find the resource requested resource: {resource}.", + "key" : "common.api.resource", + "context" : { + "resource" : "aResource" + } + } ] + } + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to invalid credentials.", + "key" : "common.api.token", + "context" : { + "accessToken" : "expired" + } + } ] + } + x-BbAccessControl-resource: WALLET + x-BbAccessControl-function: MANAGE_PAYMENT_CARDS + x-BbAccessControl-privilege: WRITE_PAYMENT_CARD + /wallet/paymentcards/{cardId}: + summary: Payment Card + description: No description available + get: + tags: + - wallet + summary: Returns details of a specific payment card. + description: Returns details of a specific payment card + operationId: getCardIdByCardId + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCard' + examples: + example: + value: |- + { + "id" : "a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1", + "pan" : "5434111122223333", + "cvc" : "123", + "startDate" : "0116", + "expiryDate" : "1219", + "nameOnCard" : "Mr Timmy Tester", + "creationDate" : "2011-05-30T12:13:14+03:00", + "balance" : { + "amount" : "1000", + "currencyCode" : "EUR" + }, + "apr" : 12.75 + } + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: |- + { + "message" : "Bad Request", + "errors" : [ { + "message" : "Value Exceeded. Must be between {min} and {max}.", + "key" : "common.api.shoesize", + "context" : { + "max" : "50", + "min" : "1" + } + } ] + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to an insufficient user quota of {quota}.", + "key" : "common.api.quota", + "context" : { + "quota" : "someQuota" + } + } ] + } + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: |- + { + "message" : "Unsupported media type.", + "errors" : [ { + "message" : "The request entity has a media type {mediaType} which the resource does not support.", + "key" : "common.api.mediaType", + "context" : { + "mediaType" : "application/javascript" + } + } ] + } + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: |- + { + "message" : "Resource not found.", + "errors" : [ { + "message" : "Unable to find the resource requested resource: {resource}.", + "key" : "common.api.resource", + "context" : { + "resource" : "aResource" + } + } ] + } + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to invalid credentials.", + "key" : "common.api.token", + "context" : { + "accessToken" : "expired" + } + } ] + } + x-BbAccessControl-resource: WALLET + x-BbAccessControl-function: MANAGE_PAYMENT_CARDS + x-BbAccessControl-privilege: READ_PAYMENT_CARD + delete: + tags: + - wallet + summary: Deletes a payment card with a given id. + description: Deletes a payment card with a given id + operationId: deleteCardIdByCardId + responses: + "204": + description: Payment card is succesfully deleted + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: |- + { + "message" : "Bad Request", + "errors" : [ { + "message" : "Value Exceeded. Must be between {min} and {max}.", + "key" : "common.api.shoesize", + "context" : { + "max" : "50", + "min" : "1" + } + } ] + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to an insufficient user quota of {quota}.", + "key" : "common.api.quota", + "context" : { + "quota" : "someQuota" + } + } ] + } + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: |- + { + "message" : "Unsupported media type.", + "errors" : [ { + "message" : "The request entity has a media type {mediaType} which the resource does not support.", + "key" : "common.api.mediaType", + "context" : { + "mediaType" : "application/javascript" + } + } ] + } + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: |- + { + "message" : "Resource not found.", + "errors" : [ { + "message" : "Unable to find the resource requested resource: {resource}.", + "key" : "common.api.resource", + "context" : { + "resource" : "aResource" + } + } ] + } + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to invalid credentials.", + "key" : "common.api.token", + "context" : { + "accessToken" : "expired" + } + } ] + } + x-BbAccessControl-resource: WALLET + x-BbAccessControl-function: MANAGE_PAYMENT_CARDS + x-BbAccessControl-privilege: DELETE_PAYMENT_CARD + parameters: + - name: cardId + in: path + description: No description available + required: true + schema: + type: string + examples: + example: + summary: example + /bbt/build-info: + summary: /build-info + description: No description available + get: + tags: + - bbt + summary: Build Information. + description: Build Information + operationId: getBuildinfo + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/BbtBuild-infoGetGetResponseBody' + examples: + example: + value: |- + { + "build-info" : { + "build.version" : "1.1.111-SNAPSHOT" + } + } + /patch: + summary: patch + description: PATCH endpoint for test operations + patch: + tags: + - patch + summary: Patch Test. + description: Patch Test + operationId: patchPatch + parameters: + - name: X-Request-Id + in: header + description: Correlates HTTP requests between a client and server. + required: false + schema: + type: string + examples: + example: + summary: example + value: f058ebd6-02f7-4d3f-942e-904344e8cde5 + responses: + "200": + description: No description available + content: {} + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: |- + { + "message" : "Bad Request", + "errors" : [ { + "message" : "Value Exceeded. Must be between {min} and {max}.", + "key" : "common.api.shoesize", + "context" : { + "max" : "50", + "min" : "1" + } + } ] + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to an insufficient user quota of {quota}.", + "key" : "common.api.quota", + "context" : { + "quota" : "someQuota" + } + } ] + } + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: |- + { + "message" : "Unsupported media type.", + "errors" : [ { + "message" : "The request entity has a media type {mediaType} which the resource does not support.", + "key" : "common.api.mediaType", + "context" : { + "mediaType" : "application/javascript" + } + } ] + } + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: |- + { + "message" : "Resource not found.", + "errors" : [ { + "message" : "Unable to find the resource requested resource: {resource}.", + "key" : "common.api.resource", + "context" : { + "resource" : "aResource" + } + } ] + } + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to invalid credentials.", + "key" : "common.api.token", + "context" : { + "accessToken" : "expired" + } + } ] + } + /test/required-boolean-query-param: + summary: required boolean query param + description: arbitrary tests + get: + tags: + - test + description: No description available + operationId: getRequiredbooleanqueryparam + parameters: + - name: bool + in: query + description: Required boolean parameter with no default value + required: true + schema: + type: boolean + examples: + example: + summary: example + value: false + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/RequiredbooleanqueryparamGetResponseBody' + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: |- + { + "message" : "Bad Request", + "errors" : [ { + "message" : "Value Exceeded. Must be between {min} and {max}.", + "key" : "common.api.shoesize", + "context" : { + "max" : "50", + "min" : "1" + } + } ] + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to an insufficient user quota of {quota}.", + "key" : "common.api.quota", + "context" : { + "quota" : "someQuota" + } + } ] + } + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: |- + { + "message" : "Unsupported media type.", + "errors" : [ { + "message" : "The request entity has a media type {mediaType} which the resource does not support.", + "key" : "common.api.mediaType", + "context" : { + "mediaType" : "application/javascript" + } + } ] + } + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: |- + { + "message" : "Resource not found.", + "errors" : [ { + "message" : "Unable to find the resource requested resource: {resource}.", + "key" : "common.api.resource", + "context" : { + "resource" : "aResource" + } + } ] + } + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to invalid credentials.", + "key" : "common.api.token", + "context" : { + "accessToken" : "expired" + } + } ] + } + /test/values: + summary: Test Values + description: Test Values + get: + tags: + - test + description: No description available + operationId: getValues + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/TestValuesGetResponseBody' + examples: + example: + value: |- + { + "message" : "a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1", + "number" : "102.4" + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + /test/headers: + summary: Test header propagation + description: Test header propagation + get: + tags: + - test + description: No description available + operationId: getHeaders + parameters: + - name: addHops + in: query + description: number of additional hops to perform + required: false + schema: + type: integer + format: int32 + examples: + example: + summary: example + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/TestHeadersResponseBody' + examples: + example: + value: |- + { + "requests" : [ { + "name" : "building-blocks-test-wallet-presentation-service", + "url" : "/client-api/v1/test/headers", + "headers" : { + "correlation-id" : [ "2ed475b714a3945a" ], + "accept" : [ "application/json" ], + "x-bbt-test" : [ "X-BBT-contentVal2" ], + "connection" : [ "keep-alive" ] + } + }, { + "name" : "building-blocks-test-wallet-pandp-service", + "url" : "/service-api/v1/test/headers", + "headers" : { + "authorization" : [ "Bearer eyJh" ], + "accept" : [ "application/xml, text/xml, application/json, application/*+xml, application/*+json" ], + "content-type" : [ "application/json" ], + "x-cxt-user-token" : [ "Bearer ey" ], + "x-cxt-remote-user" : [ "admin" ], + "x-cxt-requestuuid" : [ "72002652-131a-4f28-bd00-16b8080932f5" ], + "correlation-id" : [ "2ed475b714a3945a" ], + "x-bbt-test" : [ "X-BBT-contentVal2" ] + } + }, { + "name" : "building-blocks-test-wallet-pandp-service", + "url" : "/service-api/v1/test/headers", + "headers" : { + "authorization" : [ "Bearer eyJh" ], + "accept" : [ "application/xml, text/xml, application/json, application/*+xml, application/*+json" ], + "content-type" : [ "application/json" ], + "x-cxt-user-token" : [ "Bearer ey" ], + "x-cxt-remote-user" : [ "admin" ], + "x-cxt-requestuuid" : [ "72002652-131a-4f28-bd00-16b8080932f5" ], + "correlation-id" : [ "2ed475b714a3945a" ], + "x-bbt-test" : [ "X-BBT-contentVal2" ] + } + } ] + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + /test/date-query-params: + summary: dateQueryParam + description: | + Tests for date/time query parameters in service-apis. Sends the same query parameters to the equivalent endpoint + in the pandp service which echoes the given values back in the response body. Values echoed by the pandp service + are then returned in the response to this request. + get: + tags: + - test + description: No description available + operationId: getDatequeryparams + parameters: + - name: dateTimeOnly + in: query + description: Creation date in datetime-only format + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 2017-10-04T14:54:36 + - name: dateTime + in: query + description: Creation date in Zoned RFC3339 Date-time format + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 2017-10-04T14:54:36Z + - name: dateTime2616 + in: query + description: Zoned RFC2616 Date-time param example + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: Wed, 4 Jul 2001 12:08:56 PDT + - name: date + in: query + description: Date-only param example + required: false + schema: + type: string + format: date + examples: + example: + summary: example + value: 2017-10-04 + - name: time + in: query + description: time-only param example + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 14:54:36 + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/DateQueryParamGetResponseBody' +components: + schemas: + BadRequestError: + required: + - message + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + BbAccessControl: + required: + - function + - privilege + - resource + type: object + properties: + resource: + type: string + description: Resource being protected, e.g. 'User' + function: + type: string + description: Business function, e.g. 'Manage Users' + privilege: + type: string + description: The privilege required, e.g. 'view' + BbApiDeprecation: + required: + - deprecatedFromVersion + - description + - reason + - removedFromVersion + type: object + properties: + deprecatedFromVersion: + type: string + description: Version of the product from which the endpoint has been deprecated + and should no longer be used + deprecated: true + removedFromVersion: + type: string + description: Version of the product from which the API endpoint will be + removed + reason: + type: string + description: The reason the API endpoint was deprecated + deprecated: true + description: + type: string + description: Any further information, e.g. migration information + BbtBuild-infoGetGetResponseBody: + type: object + properties: + build-info: + type: object + example: + build-info: + build.version: 1.1.111-SNAPSHOT + BbtbuildInfogetgetresponsebody: + type: object + properties: + build-info: + type: object + example: + build-info: + build.version: 1.1.111-SNAPSHOT + Currency: + title: Monetary Amount + required: + - amount + - currencyCode + type: object + properties: + amount: + type: string + description: The amount in the specified currency + currencyCode: + pattern: ^[A-Z]{3}$ + type: string + description: The alpha-3 code (complying with ISO 4217) of the currency + that qualifies the amount + description: Schema defining monetary amount in given currency. + DateQueryParamGetResponseBody: + type: object + properties: + dateTimeOnly: + type: string + dateTimeOnlyParsedValue: + type: string + dateTime: + type: string + dateTimeParsedValue: + type: string + dateTime2616: + type: string + dateTime2616ParsedValue: + type: string + date: + type: string + dateParsedValue: + type: string + time: + type: string + timeParsedValue: + type: string + formatDateTime: + type: string + description: The dateTime parameter formatted as 'date-time', java.util.Date + or java.time.ZoneDateTime + format: date-time + formatDate: + type: string + description: The date parameter formatted as 'date', String or java.time.LocalDate + format: date + formatTime: + type: string + description: The time parameter formatted as 'time', String or java.time.LocalTime + formatUtcMillisec: + type: string + description: The dateTime parameter formatted as 'date', long + ErrorItem: + type: object + properties: + message: + type: string + description: Default Message. Any further information. + key: + type: string + description: '{capability-name}.api.{api-key-name}. For generated validation + errors this is the path in the document the error resolves to. e.g. object + name + ''.'' + field' + context: + type: object + description: Context can be anything used to construct localised messages. + description: A validation error + ForbiddenError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + InternalServerError: + required: + - message + type: object + properties: + message: + type: string + description: Further Information + description: Represents HTTP 500 Internal Server Error + NotAcceptableError: + type: object + properties: + message: + type: string + supportedMediaTypes: + type: array + description: List of supported media types for this endpoint + items: + type: string + NotFoundError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + ObjectWrappingException: + type: object + properties: + message: + type: string + data: + type: object + PaymentCard: + required: + - cvc + - expiryDate + - id + - nameOnCard + - pan + - startDate + type: object + properties: + id: + type: string + pan: + maxLength: 19 + type: string + description: Must be sixteen digits, optionally in blocks of 4 separated + by a dash + cvc: + maxLength: 3 + minLength: 3 + type: string + description: Card Verification Code + startDate: + pattern: ^(0[1-9]|1[0-2])/?([0-9]{4}|[0-9]{2})$ + type: string + description: 'Must be in one of these four formats: MM/YY MMYY MMYYYY MM/YYYY' + expiryDate: + pattern: ^(0[1-9]|1[0-2])/?([0-9]{4}|[0-9]{2})$ + type: string + description: 'Must be in one of these four formats: MM/YY MMYY MMYYYY MM/YYYY' + nameOnCard: + type: string + creationDate: + type: string + format: date-time + balance: + $ref: '#/components/schemas/Currency' + apr: + type: number + cardtype: + type: string + enum: + - CREDIT + - DEBIT + - PREPAID + PaymentCards: + type: array + items: + $ref: '#/components/schemas/PaymentCard' + PaymentCardsPostResponseBody: + type: object + properties: + id: + type: string + example: + id: a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1 + RequiredbooleanqueryparamGetResponseBody: + type: object + properties: + message: + type: string + TestHeadersResponseBody: + type: object + properties: + requests: + type: array + items: + type: object + properties: + name: + type: string + url: + type: string + headers: + type: object + TestValuesGetResponseBody: + type: object + properties: + message: + type: string + number: + type: string + example: + message: a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1 + number: "102.4" + UnauthorizedAltError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + UnauthorizedError: + required: + - message + type: object + properties: + message: + type: string + UnsupportedMediaTypeError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-integration-api/index.html b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-integration-api/index.html new file mode 100644 index 000000000..ef9076b62 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-integration-api/index.html @@ -0,0 +1,24 @@ + + + + Example + + + + + + + + + + + + + \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-integration-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-integration-api/openapi.yaml new file mode 100644 index 000000000..8cd891f41 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-integration-api/openapi.yaml @@ -0,0 +1,51 @@ +openapi: 3.0.1 +info: + title: Example + description: | + # Example + Test Schema to test an integration-api + version: v1 +servers: +- url: /serviceName/integration-api/v1 + description: The server +tags: +- name: example +paths: + /items: + summary: items + description: Retrieve all items. + get: + tags: + - items + summary: Retrieve list of all items. + description: Retrieve list of all items. + operationId: getItems + responses: + "200": + description: Test Schema + content: + application/json: + schema: + $ref: '#/components/schemas/ItemsGetResponseBody' + examples: + example: + value: |- + { + "name" : "Example", + "description" : "Example description" + } +components: + schemas: + ItemsGetResponseBody: + required: + - name + type: object + properties: + name: + type: string + description: + type: string + description: this models a simple item. + example: + name: Example + description: Example description diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-service-api/index.html b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-service-api/index.html new file mode 100644 index 000000000..c9863ec40 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-service-api/index.html @@ -0,0 +1,24 @@ + + + + Wallet Test Service API + + + + + + + + + + + + + \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-service-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-service-api/openapi.yaml new file mode 100644 index 000000000..1506d526d --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-bundle-ship/src/main/resources/presentation-service-api/openapi.yaml @@ -0,0 +1,1103 @@ +openapi: 3.0.1 +info: + title: Wallet Test Service API + description: No description available + version: v1 +servers: +- url: /serviceName/service-api/v1 + description: The server +tags: +- name: wallet test service api +paths: + /wallet/admin/{userId}/paymentcards: + summary: Payment Cards + description: No description available + get: + tags: + - wallet + summary: Returns available payment card details for user, optionally filtered + by nameOnCard. + description: Returns available payment card details for user, optionally filtered + by nameOnCard + operationId: getPaymentcardsByUserId + parameters: + - name: nameOnCard + in: query + description: Filter by the cardholder's name (case-insensitive), can be the + first one or more characters of one of the words/names + required: false + schema: + type: string + examples: + example: + summary: example + value: Smi + - name: dateTimeOnly + in: query + description: Creation date in datetime-only format + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 2017-10-04T14:54:36 + - name: dateTime + in: query + description: Creation date in Zoned RFC3339 Date-time format + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 2017-10-04T14:54:36Z + - name: dateTime2616 + in: query + description: Zoned RFC2616 Date-time param example + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: Wed, 4 Jul 2001 12:08:56 PDT + - name: date + in: query + description: Date-only param example + required: false + schema: + type: string + format: date + examples: + example: + summary: example + value: 2017-10-04 + - name: time + in: query + description: time-only param example + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 14:54:36 + - name: orderBy + in: query + description: | + Order by field: nameOnCard + required: false + schema: + type: string + examples: + example: + summary: example + - name: direction + in: query + description: Direction + required: false + schema: + type: string + enum: + - ASC + - DESC + default: DESC + examples: + example: + summary: example + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCards' + examples: + example: + value: |- + [ { + "id" : "a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1", + "pan" : "5434111122223333", + "cvc" : "123", + "startDate" : "0116", + "expiryDate" : "1219", + "nameOnCard" : "Mr Timmy Tester", + "creationDate" : "2011-05-30T12:13:14+03:00", + "balance" : { + "amount" : "2001", + "currencyCode" : "EUR" + }, + "apr" : 12.75 + }, { + "id" : "d593c212-70ad-41a6-a547-d5d9232414cb", + "pan" : "5434111122224444", + "cvc" : "101", + "startDate" : "0216", + "expiryDate" : "0120", + "nameOnCard" : "Mr Timmothy Tester", + "creationDate" : "2011-05-30T12:13:14+03:00", + "balance" : { + "amount" : "4.4399999999999995", + "currencyCode" : "GBP" + }, + "apr" : 12.75 + }, { + "id" : "9635966b-28e9-4479-8121-bb7bc9beeb62", + "pan" : "5434121212121212", + "cvc" : "121", + "startDate" : "0115", + "expiryDate" : "1218", + "nameOnCard" : "Mr Timmy Tester", + "creationDate" : "2011-05-30T12:13:14+03:00", + "balance" : { + "amount" : "1981", + "currencyCode" : "EUR" + }, + "apr" : 12.75 + } ] + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: |- + { + "message" : "Bad Request", + "errors" : [ { + "message" : "Value Exceeded. Must be between {min} and {max}.", + "key" : "common.api.shoesize", + "context" : { + "max" : "50", + "min" : "1" + } + } ] + } + "406": + description: NotAcceptable + content: + application/json: + schema: + $ref: '#/components/schemas/NotAcceptableError' + examples: + example: + value: |- + { + "message" : "Could not find acceptable representation", + "supportedMediaTypes" : [ "application/json" ] + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to an insufficient user quota of {quota}.", + "key" : "common.api.quota", + "context" : { + "quota" : "someQuota" + } + } ] + } + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: |- + { + "message" : "Unsupported media type.", + "errors" : [ { + "message" : "The request entity has a media type {mediaType} which the resource does not support.", + "key" : "common.api.mediaType", + "context" : { + "mediaType" : "application/javascript" + } + } ] + } + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: |- + { + "message" : "Resource not found.", + "errors" : [ { + "message" : "Unable to find the resource requested resource: {resource}.", + "key" : "common.api.resource", + "context" : { + "resource" : "aResource" + } + } ] + } + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to invalid credentials.", + "key" : "common.api.token", + "context" : { + "accessToken" : "expired" + } + } ] + } + post: + tags: + - wallet + summary: Adds a payment card to the user's wallet. + description: Adds a payment card to the user's wallet + operationId: postPaymentcardsByUserId + parameters: + - name: X-Request-Id + in: header + description: Correlates HTTP requests between a client and server. + required: false + schema: + type: string + examples: + example: + summary: example + value: f058ebd6-02f7-4d3f-942e-904344e8cde5 + requestBody: + description: Adds a payment card to the user's wallet + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCard' + examples: + example: + value: |- + { + "id" : "a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1", + "pan" : "5434111122223333", + "cvc" : "123", + "startDate" : "0116", + "expiryDate" : "1219", + "nameOnCard" : "Mr Timmy Tester", + "creationDate" : "2011-05-30T12:13:14+03:00", + "balance" : { + "amount" : "1000", + "currencyCode" : "EUR" + }, + "apr" : 12.75 + } + responses: + "201": + description: request to create payment card accepted + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCardsPostResponseBody' + examples: + example: + value: |- + { + "id" : "a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1" + } + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: |- + { + "message" : "Bad Request", + "errors" : [ { + "message" : "Value Exceeded. Must be between {min} and {max}.", + "key" : "common.api.shoesize", + "context" : { + "max" : "50", + "min" : "1" + } + } ] + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to an insufficient user quota of {quota}.", + "key" : "common.api.quota", + "context" : { + "quota" : "someQuota" + } + } ] + } + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: |- + { + "message" : "Unsupported media type.", + "errors" : [ { + "message" : "The request entity has a media type {mediaType} which the resource does not support.", + "key" : "common.api.mediaType", + "context" : { + "mediaType" : "application/javascript" + } + } ] + } + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: |- + { + "message" : "Resource not found.", + "errors" : [ { + "message" : "Unable to find the resource requested resource: {resource}.", + "key" : "common.api.resource", + "context" : { + "resource" : "aResource" + } + } ] + } + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to invalid credentials.", + "key" : "common.api.token", + "context" : { + "accessToken" : "expired" + } + } ] + } + parameters: + - name: userId + in: path + description: No description available + required: true + schema: + type: string + examples: + example: + summary: example + /wallet/admin/{userId}/paymentcards/{cardId}: + summary: Payment Card + description: No description available + get: + tags: + - wallet + summary: Returns details of a specific payment card. + description: Returns details of a specific payment card + operationId: getCardIdByUserIdAndCardId + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCard' + examples: + example: + value: |- + { + "id" : "a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1", + "pan" : "5434111122223333", + "cvc" : "123", + "startDate" : "0116", + "expiryDate" : "1219", + "nameOnCard" : "Mr Timmy Tester", + "creationDate" : "2011-05-30T12:13:14+03:00", + "balance" : { + "amount" : "1000", + "currencyCode" : "EUR" + }, + "apr" : 12.75 + } + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: |- + { + "message" : "Bad Request", + "errors" : [ { + "message" : "Value Exceeded. Must be between {min} and {max}.", + "key" : "common.api.shoesize", + "context" : { + "max" : "50", + "min" : "1" + } + } ] + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to an insufficient user quota of {quota}.", + "key" : "common.api.quota", + "context" : { + "quota" : "someQuota" + } + } ] + } + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: |- + { + "message" : "Unsupported media type.", + "errors" : [ { + "message" : "The request entity has a media type {mediaType} which the resource does not support.", + "key" : "common.api.mediaType", + "context" : { + "mediaType" : "application/javascript" + } + } ] + } + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: |- + { + "message" : "Resource not found.", + "errors" : [ { + "message" : "Unable to find the resource requested resource: {resource}.", + "key" : "common.api.resource", + "context" : { + "resource" : "aResource" + } + } ] + } + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to invalid credentials.", + "key" : "common.api.token", + "context" : { + "accessToken" : "expired" + } + } ] + } + delete: + tags: + - wallet + summary: Deletes a payment card with a given id. + description: Deletes a payment card with a given id + operationId: deleteCardIdByUserIdAndCardId + responses: + "204": + description: Payment card is succesfully deleted + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: |- + { + "message" : "Bad Request", + "errors" : [ { + "message" : "Value Exceeded. Must be between {min} and {max}.", + "key" : "common.api.shoesize", + "context" : { + "max" : "50", + "min" : "1" + } + } ] + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to an insufficient user quota of {quota}.", + "key" : "common.api.quota", + "context" : { + "quota" : "someQuota" + } + } ] + } + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: |- + { + "message" : "Unsupported media type.", + "errors" : [ { + "message" : "The request entity has a media type {mediaType} which the resource does not support.", + "key" : "common.api.mediaType", + "context" : { + "mediaType" : "application/javascript" + } + } ] + } + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: |- + { + "message" : "Resource not found.", + "errors" : [ { + "message" : "Unable to find the resource requested resource: {resource}.", + "key" : "common.api.resource", + "context" : { + "resource" : "aResource" + } + } ] + } + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to invalid credentials.", + "key" : "common.api.token", + "context" : { + "accessToken" : "expired" + } + } ] + } + parameters: + - name: cardId + in: path + description: No description available + required: true + schema: + type: string + examples: + example: + summary: example + - name: userId + in: path + description: No description available + required: true + schema: + type: string + examples: + example: + summary: example + /testQuery/required-boolean-query-param: + summary: required boolean query param + description: arbitrary tests + get: + tags: + - testQuery + description: No description available + operationId: getRequiredbooleanqueryparam + parameters: + - name: bool + in: query + description: Required boolean parameter with no default value + required: true + schema: + type: boolean + examples: + example: + summary: example + value: false + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/RequiredbooleanqueryparamGetResponseBody' + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: |- + { + "message" : "Bad Request", + "errors" : [ { + "message" : "Value Exceeded. Must be between {min} and {max}.", + "key" : "common.api.shoesize", + "context" : { + "max" : "50", + "min" : "1" + } + } ] + } + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: |- + { + "message" : "Description of error" + } + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to an insufficient user quota of {quota}.", + "key" : "common.api.quota", + "context" : { + "quota" : "someQuota" + } + } ] + } + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: |- + { + "message" : "Unsupported media type.", + "errors" : [ { + "message" : "The request entity has a media type {mediaType} which the resource does not support.", + "key" : "common.api.mediaType", + "context" : { + "mediaType" : "application/javascript" + } + } ] + } + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: |- + { + "message" : "Resource not found.", + "errors" : [ { + "message" : "Unable to find the resource requested resource: {resource}.", + "key" : "common.api.resource", + "context" : { + "resource" : "aResource" + } + } ] + } + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: |- + { + "message" : "Access to requested resource denied.", + "errors" : [ { + "message" : "Resource access denied due to invalid credentials.", + "key" : "common.api.token", + "context" : { + "accessToken" : "expired" + } + } ] + } +components: + schemas: + BadRequestError: + required: + - message + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + BbAccessControl: + required: + - function + - privilege + - resource + type: object + properties: + resource: + type: string + description: Resource being protected, e.g. 'User' + function: + type: string + description: Business function, e.g. 'Manage Users' + privilege: + type: string + description: The privilege required, e.g. 'view' + BbApiDeprecation: + required: + - deprecatedFromVersion + - description + - reason + - removedFromVersion + type: object + properties: + deprecatedFromVersion: + type: string + description: Version of the product from which the endpoint has been deprecated + and should no longer be used + deprecated: true + removedFromVersion: + type: string + description: Version of the product from which the API endpoint will be + removed + reason: + type: string + description: The reason the API endpoint was deprecated + deprecated: true + description: + type: string + description: Any further information, e.g. migration information + Currency: + title: Monetary Amount + required: + - amount + - currencyCode + type: object + properties: + amount: + type: string + description: The amount in the specified currency + currencyCode: + pattern: ^[A-Z]{3}$ + type: string + description: The alpha-3 code (complying with ISO 4217) of the currency + that qualifies the amount + description: Schema defining monetary amount in given currency. + ErrorItem: + type: object + properties: + message: + type: string + description: Default Message. Any further information. + key: + type: string + description: '{capability-name}.api.{api-key-name}. For generated validation + errors this is the path in the document the error resolves to. e.g. object + name + ''.'' + field' + context: + type: object + description: Context can be anything used to construct localised messages. + description: A validation error + ForbiddenError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + InternalServerError: + required: + - message + type: object + properties: + message: + type: string + description: Further Information + description: Represents HTTP 500 Internal Server Error + NotAcceptableError: + type: object + properties: + message: + type: string + supportedMediaTypes: + type: array + description: List of supported media types for this endpoint + items: + type: string + NotFoundError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + ObjectWrappingException: + type: object + properties: + message: + type: string + data: + type: object + PaymentCard: + required: + - cvc + - expiryDate + - id + - nameOnCard + - pan + - startDate + type: object + properties: + id: + type: string + pan: + maxLength: 19 + type: string + description: Must be sixteen digits, optionally in blocks of 4 separated + by a dash + cvc: + maxLength: 3 + minLength: 3 + type: string + description: Card Verification Code + startDate: + pattern: ^(0[1-9]|1[0-2])/?([0-9]{4}|[0-9]{2})$ + type: string + description: 'Must be in one of these four formats: MM/YY MMYY MMYYYY MM/YYYY' + expiryDate: + pattern: ^(0[1-9]|1[0-2])/?([0-9]{4}|[0-9]{2})$ + type: string + description: 'Must be in one of these four formats: MM/YY MMYY MMYYYY MM/YYYY' + nameOnCard: + type: string + creationDate: + type: string + format: date-time + balance: + $ref: '#/components/schemas/Currency' + apr: + type: number + cardtype: + type: string + enum: + - CREDIT + - DEBIT + - PREPAID + PaymentCards: + type: array + items: + $ref: '#/components/schemas/PaymentCard' + PaymentCardsPostResponseBody: + type: object + properties: + id: + type: string + example: + id: a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1 + RequiredbooleanqueryparamGetResponseBody: + type: object + properties: + message: + type: string + TestHeadersResponseBody: + type: object + properties: + requests: + type: array + items: + type: object + properties: + name: + type: string + url: + type: string + headers: + type: object + UnauthorizedAltError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + UnauthorizedError: + required: + - message + type: object + properties: + message: + type: string + UnsupportedMediaTypeError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' diff --git a/boat-maven-plugin/src/it/example/boat-ship/pom.xml b/boat-maven-plugin/src/it/example/boat-ship/pom.xml new file mode 100644 index 000000000..722e635f9 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-ship/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + + com.backbase.oss.boat.example + example + 1.0.0-SNAPSHOT + + + boat-ship + 1.0.0-SNAPSHOT + + BOAT :: Ship Example + + + + + com.backbase.oss + boat-maven-plugin + + + ship + package + + ship + + + + + + + + + diff --git a/boat-maven-plugin/src/it/example/boat-ship/src/assembly/build.xml b/boat-maven-plugin/src/it/example/boat-ship/src/assembly/build.xml new file mode 100644 index 000000000..8a0b62203 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-ship/src/assembly/build.xml @@ -0,0 +1,18 @@ + + api + + zip + + false + + + src/main/resources/ + ${artifactId} + + **/** + + + + \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-client-api/index.html b/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-client-api/index.html new file mode 100644 index 000000000..80aa61995 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-client-api/index.html @@ -0,0 +1,24 @@ + + + + Wallet Test Client API + + + + + + + + + + + + + \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-client-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-client-api/openapi.yaml new file mode 100644 index 000000000..eed41ab6d --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-client-api/openapi.yaml @@ -0,0 +1,1223 @@ +openapi: 3.0.3 +info: + title: Wallet Test Client API + description: No description available + version: 2.19.0 +servers: +- url: /artifact-service/ + description: The server +tags: +- name: wallet test client api +paths: + /client-api/v1/wallet/paymentcards: + summary: Payment Cards + description: No description available + get: + tags: + - wallet + summary: "Returns available payment card details for user, optionally filtered\ + \ by nameOnCard." + description: "Returns available payment card details for user, optionally filtered\ + \ by nameOnCard" + operationId: getPaymentCards + parameters: + - name: nameOnCard + in: query + description: "Filter by the cardholder's name (case-insensitive), can be the\ + \ first one or more characters of one of the words/names" + required: false + schema: + type: string + examples: + example: + summary: example + value: Smi + - name: dateTimeOnly + in: query + description: Creation date in datetime-only format + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 2017-10-04T14:54:36 + - name: dateTime + in: query + description: Creation date in Zoned RFC3339 Date-time format + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 2017-10-04T14:54:36Z + - name: dateTime2616 + in: query + description: Zoned RFC2616 Date-time param example + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: "Wed, 4 Jul 2001 12:08:56 PDT" + - name: date + in: query + description: Date-only param example + required: false + schema: + type: string + format: date + examples: + example: + summary: example + value: 2017-10-04 + - name: time + in: query + description: time-only param example + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 14:54:36 + - name: orderBy + in: query + description: "Order by field: nameOnCard\n" + required: false + schema: + type: string + examples: + example: + summary: example + - name: direction + in: query + description: Direction + required: false + schema: + type: string + default: DESC + enum: + - ASC + - DESC + examples: + example: + summary: example + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCards' + examples: + example: + value: "[ {\n \"id\" : \"a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1\"\ + ,\n \"pan\" : \"5434111122223333\",\n \"cvc\" : \"123\",\n \ + \ \"startDate\" : \"0116\",\n \"expiryDate\" : \"1219\",\n \"\ + nameOnCard\" : \"Mr Timmy Tester\",\n \"creationDate\" : \"2011-05-30T12:13:14+03:00\"\ + ,\n \"balance\" : {\n \"amount\" : \"2001\",\n \"currencyCode\"\ + \ : \"EUR\"\n },\n \"apr\" : 12.75\n}, {\n \"id\" : \"d593c212-70ad-41a6-a547-d5d9232414cb\"\ + ,\n \"pan\" : \"5434111122224444\",\n \"cvc\" : \"101\",\n \ + \ \"startDate\" : \"0216\",\n \"expiryDate\" : \"0120\",\n \"\ + nameOnCard\" : \"Mr Timmothy Tester\",\n \"creationDate\" : \"\ + 2011-05-30T12:13:14+03:00\",\n \"balance\" : {\n \"amount\"\ + \ : \"4.4399999999999995\",\n \"currencyCode\" : \"GBP\"\n\ + \ },\n \"apr\" : 12.75\n}, {\n \"id\" : \"9635966b-28e9-4479-8121-bb7bc9beeb62\"\ + ,\n \"pan\" : \"5434121212121212\",\n \"cvc\" : \"121\",\n \ + \ \"startDate\" : \"0115\",\n \"expiryDate\" : \"1218\",\n \"\ + nameOnCard\" : \"Mr Timmy Tester\",\n \"creationDate\" : \"2011-05-30T12:13:14+03:00\"\ + ,\n \"balance\" : {\n \"amount\" : \"1981\",\n \"currencyCode\"\ + \ : \"EUR\"\n },\n \"apr\" : 12.75\n} ]" + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: "{\n \"message\" : \"Bad Request\",\n \"errors\" : [ {\n\ + \ \"message\" : \"Value Exceeded. Must be between {min} and\ + \ {max}.\",\n \"key\" : \"common.api.shoesize\",\n \"context\"\ + \ : {\n \"max\" : \"50\",\n \"min\" : \"1\"\n }\n\ + \ } ]\n}" + "406": + description: NotAcceptable + content: + application/json: + schema: + $ref: '#/components/schemas/NotAcceptableError' + examples: + example: + value: "{\n \"message\" : \"Could not find acceptable representation\"\ + ,\n \"supportedMediaTypes\" : [ \"application/json\" ]\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to an insufficient user quota of {quota}.\",\n \"key\"\ + \ : \"common.api.quota\",\n \"context\" : {\n \"quota\"\ + \ : \"someQuota\"\n }\n } ]\n}" + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: "{\n \"message\" : \"Unsupported media type.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"The request entity has a media type\ + \ {mediaType} which the resource does not support.\",\n \"\ + key\" : \"common.api.mediaType\",\n \"context\" : {\n \ + \ \"mediaType\" : \"application/javascript\"\n }\n } ]\n}" + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: "{\n \"message\" : \"Resource not found.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"Unable to find the resource requested\ + \ resource: {resource}.\",\n \"key\" : \"common.api.resource\"\ + ,\n \"context\" : {\n \"resource\" : \"aResource\"\n \ + \ }\n } ]\n}" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to invalid credentials.\",\n \"key\" : \"common.api.token\"\ + ,\n \"context\" : {\n \"accessToken\" : \"expired\"\n\ + \ }\n } ]\n}" + x-bb-access-control-resource: WALLET + x-bb-access-control-function: MANAGE_PAYMENT_CARDS + x-bb-access-control-privilege: READ_PAYMENT_CARD + post: + tags: + - wallet + summary: Adds a payment card to the user's wallet. + description: Adds a payment card to the user's wallet + operationId: postPaymentCards + parameters: + - name: X-Request-Id + in: header + description: Correlates HTTP requests between a client and server. + required: false + schema: + type: string + examples: + example: + summary: example + value: f058ebd6-02f7-4d3f-942e-904344e8cde5 + requestBody: + description: Adds a payment card to the user's wallet + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCard' + examples: + example: + value: "{\n \"id\" : \"a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1\",\n\ + \ \"pan\" : \"5434111122223333\",\n \"cvc\" : \"123\",\n \"startDate\"\ + \ : \"0116\",\n \"expiryDate\" : \"1219\",\n \"nameOnCard\" :\ + \ \"Mr Timmy Tester\",\n \"creationDate\" : \"2011-05-30T12:13:14+03:00\"\ + ,\n \"balance\" : {\n \"amount\" : \"1000\",\n \"currencyCode\"\ + \ : \"EUR\"\n },\n \"apr\" : 12.75\n}" + responses: + "201": + description: request to create payment card accepted + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCardsPostResponseBody' + examples: + example: + value: "{\n \"id\" : \"a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1\"\n\ + }" + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: "{\n \"message\" : \"Bad Request\",\n \"errors\" : [ {\n\ + \ \"message\" : \"Value Exceeded. Must be between {min} and\ + \ {max}.\",\n \"key\" : \"common.api.shoesize\",\n \"context\"\ + \ : {\n \"max\" : \"50\",\n \"min\" : \"1\"\n }\n\ + \ } ]\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to an insufficient user quota of {quota}.\",\n \"key\"\ + \ : \"common.api.quota\",\n \"context\" : {\n \"quota\"\ + \ : \"someQuota\"\n }\n } ]\n}" + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: "{\n \"message\" : \"Unsupported media type.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"The request entity has a media type\ + \ {mediaType} which the resource does not support.\",\n \"\ + key\" : \"common.api.mediaType\",\n \"context\" : {\n \ + \ \"mediaType\" : \"application/javascript\"\n }\n } ]\n}" + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: "{\n \"message\" : \"Resource not found.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"Unable to find the resource requested\ + \ resource: {resource}.\",\n \"key\" : \"common.api.resource\"\ + ,\n \"context\" : {\n \"resource\" : \"aResource\"\n \ + \ }\n } ]\n}" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to invalid credentials.\",\n \"key\" : \"common.api.token\"\ + ,\n \"context\" : {\n \"accessToken\" : \"expired\"\n\ + \ }\n } ]\n}" + x-bb-access-control-resource: WALLET + x-bb-access-control-function: MANAGE_PAYMENT_CARDS + x-bb-access-control-privilege: WRITE_PAYMENT_CARD + /client-api/v1/wallet/paymentcards/{cardId}: + summary: Payment Card + description: No description available + get: + tags: + - wallet + summary: Returns details of a specific payment card. + description: Returns details of a specific payment card + operationId: getPaymentCard + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCard' + examples: + example: + value: "{\n \"id\" : \"a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1\",\n\ + \ \"pan\" : \"5434111122223333\",\n \"cvc\" : \"123\",\n \"\ + startDate\" : \"0116\",\n \"expiryDate\" : \"1219\",\n \"nameOnCard\"\ + \ : \"Mr Timmy Tester\",\n \"creationDate\" : \"2011-05-30T12:13:14+03:00\"\ + ,\n \"balance\" : {\n \"amount\" : \"1000\",\n \"currencyCode\"\ + \ : \"EUR\"\n },\n \"apr\" : 12.75\n}" + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: "{\n \"message\" : \"Bad Request\",\n \"errors\" : [ {\n\ + \ \"message\" : \"Value Exceeded. Must be between {min} and\ + \ {max}.\",\n \"key\" : \"common.api.shoesize\",\n \"context\"\ + \ : {\n \"max\" : \"50\",\n \"min\" : \"1\"\n }\n\ + \ } ]\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to an insufficient user quota of {quota}.\",\n \"key\"\ + \ : \"common.api.quota\",\n \"context\" : {\n \"quota\"\ + \ : \"someQuota\"\n }\n } ]\n}" + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: "{\n \"message\" : \"Unsupported media type.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"The request entity has a media type\ + \ {mediaType} which the resource does not support.\",\n \"\ + key\" : \"common.api.mediaType\",\n \"context\" : {\n \ + \ \"mediaType\" : \"application/javascript\"\n }\n } ]\n}" + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: "{\n \"message\" : \"Resource not found.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"Unable to find the resource requested\ + \ resource: {resource}.\",\n \"key\" : \"common.api.resource\"\ + ,\n \"context\" : {\n \"resource\" : \"aResource\"\n \ + \ }\n } ]\n}" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to invalid credentials.\",\n \"key\" : \"common.api.token\"\ + ,\n \"context\" : {\n \"accessToken\" : \"expired\"\n\ + \ }\n } ]\n}" + x-bb-access-control-resource: WALLET + x-bb-access-control-function: MANAGE_PAYMENT_CARDS + x-bb-access-control-privilege: READ_PAYMENT_CARD + delete: + tags: + - wallet + summary: Deletes a payment card with a given id. + description: Deletes a payment card with a given id + operationId: deletePaymentCard + responses: + "204": + description: Payment card is succesfully deleted + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: "{\n \"message\" : \"Bad Request\",\n \"errors\" : [ {\n\ + \ \"message\" : \"Value Exceeded. Must be between {min} and\ + \ {max}.\",\n \"key\" : \"common.api.shoesize\",\n \"context\"\ + \ : {\n \"max\" : \"50\",\n \"min\" : \"1\"\n }\n\ + \ } ]\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to an insufficient user quota of {quota}.\",\n \"key\"\ + \ : \"common.api.quota\",\n \"context\" : {\n \"quota\"\ + \ : \"someQuota\"\n }\n } ]\n}" + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: "{\n \"message\" : \"Unsupported media type.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"The request entity has a media type\ + \ {mediaType} which the resource does not support.\",\n \"\ + key\" : \"common.api.mediaType\",\n \"context\" : {\n \ + \ \"mediaType\" : \"application/javascript\"\n }\n } ]\n}" + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: "{\n \"message\" : \"Resource not found.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"Unable to find the resource requested\ + \ resource: {resource}.\",\n \"key\" : \"common.api.resource\"\ + ,\n \"context\" : {\n \"resource\" : \"aResource\"\n \ + \ }\n } ]\n}" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to invalid credentials.\",\n \"key\" : \"common.api.token\"\ + ,\n \"context\" : {\n \"accessToken\" : \"expired\"\n\ + \ }\n } ]\n}" + x-bb-access-control-resource: WALLET + x-bb-access-control-function: MANAGE_PAYMENT_CARDS + x-bb-access-control-privilege: DELETE_PAYMENT_CARD + parameters: + - name: cardId + in: path + description: No description available + required: true + schema: + type: string + examples: + example: + summary: example + /client-api/v1/bbt/build-info: + summary: /build-info + description: No description available + get: + tags: + - bbt + summary: Build Information. + description: Build Information + operationId: getBuildinfo + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/BbtBuild-infoGetGetResponseBody' + examples: + example: + value: "{\n \"build-info\" : {\n \"build.version\" : \"1.1.111-SNAPSHOT\"\ + \n }\n}" + /client-api/v1/patch: + summary: patch + description: PATCH endpoint for test operations + patch: + tags: + - patch + summary: patch + description: Patch Test + operationId: patchpatch + parameters: + - name: X-Request-Id + in: header + description: Correlates HTTP requests between a client and server. + required: false + schema: + type: string + examples: + example: + summary: example + value: f058ebd6-02f7-4d3f-942e-904344e8cde5 + responses: + "200": + description: No description available + content: {} + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: "{\n \"message\" : \"Bad Request\",\n \"errors\" : [ {\n\ + \ \"message\" : \"Value Exceeded. Must be between {min} and\ + \ {max}.\",\n \"key\" : \"common.api.shoesize\",\n \"context\"\ + \ : {\n \"max\" : \"50\",\n \"min\" : \"1\"\n }\n\ + \ } ]\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to an insufficient user quota of {quota}.\",\n \"key\"\ + \ : \"common.api.quota\",\n \"context\" : {\n \"quota\"\ + \ : \"someQuota\"\n }\n } ]\n}" + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: "{\n \"message\" : \"Unsupported media type.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"The request entity has a media type\ + \ {mediaType} which the resource does not support.\",\n \"\ + key\" : \"common.api.mediaType\",\n \"context\" : {\n \ + \ \"mediaType\" : \"application/javascript\"\n }\n } ]\n}" + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: "{\n \"message\" : \"Resource not found.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"Unable to find the resource requested\ + \ resource: {resource}.\",\n \"key\" : \"common.api.resource\"\ + ,\n \"context\" : {\n \"resource\" : \"aResource\"\n \ + \ }\n } ]\n}" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to invalid credentials.\",\n \"key\" : \"common.api.token\"\ + ,\n \"context\" : {\n \"accessToken\" : \"expired\"\n\ + \ }\n } ]\n}" + /client-api/v1/test/required-boolean-query-param: + summary: required boolean query param + description: arbitrary tests + get: + tags: + - test + description: No description available + operationId: getrequiredBooleanQueryParam + parameters: + - name: bool + in: query + description: Required boolean parameter with no default value + required: true + schema: + type: boolean + examples: + example: + summary: example + value: false + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/RequiredbooleanqueryparamGetResponseBody' + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: "{\n \"message\" : \"Bad Request\",\n \"errors\" : [ {\n\ + \ \"message\" : \"Value Exceeded. Must be between {min} and\ + \ {max}.\",\n \"key\" : \"common.api.shoesize\",\n \"context\"\ + \ : {\n \"max\" : \"50\",\n \"min\" : \"1\"\n }\n\ + \ } ]\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to an insufficient user quota of {quota}.\",\n \"key\"\ + \ : \"common.api.quota\",\n \"context\" : {\n \"quota\"\ + \ : \"someQuota\"\n }\n } ]\n}" + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: "{\n \"message\" : \"Unsupported media type.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"The request entity has a media type\ + \ {mediaType} which the resource does not support.\",\n \"\ + key\" : \"common.api.mediaType\",\n \"context\" : {\n \ + \ \"mediaType\" : \"application/javascript\"\n }\n } ]\n}" + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: "{\n \"message\" : \"Resource not found.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"Unable to find the resource requested\ + \ resource: {resource}.\",\n \"key\" : \"common.api.resource\"\ + ,\n \"context\" : {\n \"resource\" : \"aResource\"\n \ + \ }\n } ]\n}" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to invalid credentials.\",\n \"key\" : \"common.api.token\"\ + ,\n \"context\" : {\n \"accessToken\" : \"expired\"\n\ + \ }\n } ]\n}" + /client-api/v1/test/values: + summary: Test Values + description: Test Values + get: + tags: + - test + description: No description available + operationId: getTestValues + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/TestValuesGetResponseBody' + examples: + example: + value: "{\n \"message\" : \"a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1\"\ + ,\n \"number\" : \"102.4\"\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + /client-api/v1/test/headers: + summary: Test header propagation + description: Test header propagation + get: + tags: + - test + description: No description available + operationId: getTestHeaderPropagation + parameters: + - name: addHops + in: query + description: number of additional hops to perform + required: false + schema: + type: integer + format: int32 + examples: + example: + summary: example + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/TestHeadersResponseBody' + examples: + example: + value: "{\n \"requests\" : [ {\n \"name\" : \"building-blocks-test-wallet-presentation-service\"\ + ,\n \"url\" : \"/client-api/v1/test/headers\",\n \"headers\"\ + \ : {\n \"correlation-id\" : [ \"2ed475b714a3945a\" ],\n\ + \ \"accept\" : [ \"application/json\" ],\n \"x-bbt-test\"\ + \ : [ \"X-BBT-contentVal2\" ],\n \"connection\" : [ \"keep-alive\"\ + \ ]\n }\n }, {\n \"name\" : \"building-blocks-test-wallet-pandp-service\"\ + ,\n \"url\" : \"/service-api/v1/test/headers\",\n \"headers\"\ + \ : {\n \"authorization\" : [ \"Bearer eyJh\" ],\n \"\ + accept\" : [ \"application/xml, text/xml, application/json, application/*+xml,\ + \ application/*+json\" ],\n \"content-type\" : [ \"application/json\"\ + \ ],\n \"x-cxt-user-token\" : [ \"Bearer ey\" ],\n \"\ + x-cxt-remote-user\" : [ \"admin\" ],\n \"x-cxt-requestuuid\"\ + \ : [ \"72002652-131a-4f28-bd00-16b8080932f5\" ],\n \"correlation-id\"\ + \ : [ \"2ed475b714a3945a\" ],\n \"x-bbt-test\" : [ \"X-BBT-contentVal2\"\ + \ ]\n }\n }, {\n \"name\" : \"building-blocks-test-wallet-pandp-service\"\ + ,\n \"url\" : \"/service-api/v1/test/headers\",\n \"headers\"\ + \ : {\n \"authorization\" : [ \"Bearer eyJh\" ],\n \"\ + accept\" : [ \"application/xml, text/xml, application/json, application/*+xml,\ + \ application/*+json\" ],\n \"content-type\" : [ \"application/json\"\ + \ ],\n \"x-cxt-user-token\" : [ \"Bearer ey\" ],\n \"\ + x-cxt-remote-user\" : [ \"admin\" ],\n \"x-cxt-requestuuid\"\ + \ : [ \"72002652-131a-4f28-bd00-16b8080932f5\" ],\n \"correlation-id\"\ + \ : [ \"2ed475b714a3945a\" ],\n \"x-bbt-test\" : [ \"X-BBT-contentVal2\"\ + \ ]\n }\n } ]\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + /client-api/v1/test/date-query-params: + summary: dateQueryParam + description: | + Tests for date/time query parameters in service-apis. Sends the same query parameters to the equivalent endpoint + in the pandp service which echoes the given values back in the response body. Values echoed by the pandp service + are then returned in the response to this request. + get: + tags: + - test + description: No description available + operationId: getdateQueryParam + parameters: + - name: dateTimeOnly + in: query + description: Creation date in datetime-only format + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 2017-10-04T14:54:36 + - name: dateTime + in: query + description: Creation date in Zoned RFC3339 Date-time format + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 2017-10-04T14:54:36Z + - name: dateTime2616 + in: query + description: Zoned RFC2616 Date-time param example + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: "Wed, 4 Jul 2001 12:08:56 PDT" + - name: date + in: query + description: Date-only param example + required: false + schema: + type: string + format: date + examples: + example: + summary: example + value: 2017-10-04 + - name: time + in: query + description: time-only param example + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 14:54:36 + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/DateQueryParamGetResponseBody' +components: + schemas: + BadRequestError: + required: + - message + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + BbAccessControl: + required: + - function + - privilege + - resource + type: object + properties: + resource: + type: string + description: "Resource being protected, e.g. 'User'" + function: + type: string + description: "Business function, e.g. 'Manage Users'" + privilege: + type: string + description: "The privilege required, e.g. 'view'" + BbApiDeprecation: + required: + - deprecatedFromVersion + - description + - reason + - removedFromVersion + type: object + properties: + deprecatedFromVersion: + type: string + description: Version of the product from which the endpoint has been deprecated + and should no longer be used + deprecated: true + removedFromVersion: + type: string + description: Version of the product from which the API endpoint will be + removed + reason: + type: string + description: The reason the API endpoint was deprecated + deprecated: true + description: + type: string + description: "Any further information, e.g. migration information" + BbtBuild-infoGetGetResponseBody: + type: object + properties: + build-info: + type: object + example: + build-info: + build.version: 1.1.111-SNAPSHOT + BbtbuildInfogetgetresponsebody: + type: object + properties: + build-info: + type: object + example: + build-info: + build.version: 1.1.111-SNAPSHOT + Currency: + title: Monetary Amount + required: + - amount + - currencyCode + type: object + properties: + amount: + type: string + description: The amount in the specified currency + currencyCode: + pattern: "^[A-Z]{3}$" + type: string + description: The alpha-3 code (complying with ISO 4217) of the currency + that qualifies the amount + description: Schema defining monetary amount in given currency. + DateQueryParamGetResponseBody: + type: object + properties: + dateTimeOnly: + type: string + dateTimeOnlyParsedValue: + type: string + dateTime: + type: string + dateTimeParsedValue: + type: string + dateTime2616: + type: string + dateTime2616ParsedValue: + type: string + date: + type: string + dateParsedValue: + type: string + time: + type: string + timeParsedValue: + type: string + formatDateTime: + type: string + description: "The dateTime parameter formatted as 'date-time', java.util.Date\ + \ or java.time.ZoneDateTime" + format: date-time + formatDate: + type: string + description: "The date parameter formatted as 'date', String or java.time.LocalDate" + format: date + formatTime: + type: string + description: "The time parameter formatted as 'time', String or java.time.LocalTime" + formatUtcMillisec: + type: string + description: "The dateTime parameter formatted as 'date', long" + ErrorItem: + type: object + properties: + message: + type: string + description: Default Message. Any further information. + key: + type: string + description: "{capability-name}.api.{api-key-name}. For generated validation\ + \ errors this is the path in the document the error resolves to. e.g.\ + \ object name + '.' + field" + context: + type: object + description: Context can be anything used to construct localised messages. + description: A validation error + ForbiddenError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + InternalServerError: + required: + - message + type: object + properties: + message: + type: string + description: Further Information + description: Represents HTTP 500 Internal Server Error + NotAcceptableError: + type: object + properties: + message: + type: string + supportedMediaTypes: + type: array + description: List of supported media types for this endpoint + items: + type: string + NotFoundError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + ObjectWrappingException: + type: object + properties: + message: + type: string + data: + type: object + PaymentCard: + required: + - cvc + - expiryDate + - id + - nameOnCard + - pan + - startDate + type: object + properties: + id: + type: string + pan: + maxLength: 19 + type: string + description: "Must be sixteen digits, optionally in blocks of 4 separated\ + \ by a dash" + cvc: + maxLength: 3 + minLength: 3 + type: string + description: Card Verification Code + startDate: + pattern: "^(0[1-9]|1[0-2])/?([0-9]{4}|[0-9]{2})$" + type: string + description: "Must be in one of these four formats: MM/YY MMYY MMYYYY MM/YYYY" + expiryDate: + pattern: "^(0[1-9]|1[0-2])/?([0-9]{4}|[0-9]{2})$" + type: string + description: "Must be in one of these four formats: MM/YY MMYY MMYYYY MM/YYYY" + nameOnCard: + type: string + creationDate: + type: string + format: date-time + balance: + $ref: '#/components/schemas/Currency' + apr: + type: number + cardtype: + type: string + enum: + - CREDIT + - DEBIT + - PREPAID + PaymentCards: + type: array + items: + $ref: '#/components/schemas/PaymentCard' + PaymentCardsPostResponseBody: + type: object + properties: + id: + type: string + example: + id: a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1 + RequiredbooleanqueryparamGetResponseBody: + type: object + properties: + message: + type: string + TestHeadersResponseBody: + type: object + properties: + requests: + type: array + items: + type: object + properties: + name: + type: string + url: + type: string + headers: + type: object + TestValuesGetResponseBody: + type: object + properties: + message: + type: string + number: + type: string + example: + message: a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1 + number: "102.4" + UnauthorizedAltError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + UnauthorizedError: + required: + - message + type: object + properties: + message: + type: string + UnsupportedMediaTypeError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' diff --git a/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-integration-api/index.html b/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-integration-api/index.html new file mode 100644 index 000000000..ef9076b62 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-integration-api/index.html @@ -0,0 +1,24 @@ + + + + Example + + + + + + + + + + + + + \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-integration-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-integration-api/openapi.yaml new file mode 100644 index 000000000..bf69079bf --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-integration-api/openapi.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.3 +info: + title: Example + description: | + # Example + Test Schema to test an integration-api + version: 2.19.0 +servers: +- url: /artifact-service/ + description: The server +tags: +- name: example +paths: + /integration-api/v1/items: + summary: items + description: Retrieve all items. + get: + tags: + - items + summary: Retrieve list of all items. + description: Retrieve list of all items. + operationId: getitems + responses: + "200": + description: Test Schema + content: + application/json: + schema: + $ref: '#/components/schemas/ItemsGetResponseBody' + examples: + example: + value: "{\n \"name\" : \"Example\",\n \"description\" : \"Example\ + \ description\"\n}" +components: + schemas: + ItemsGetResponseBody: + required: + - name + type: object + properties: + name: + type: string + description: + type: string + description: this models a simple item. + example: + name: Example + description: Example description diff --git a/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-service-api/index.html b/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-service-api/index.html new file mode 100644 index 000000000..c9863ec40 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-service-api/index.html @@ -0,0 +1,24 @@ + + + + Wallet Test Service API + + + + + + + + + + + + + \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-service-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-service-api/openapi.yaml new file mode 100644 index 000000000..5a2175c02 --- /dev/null +++ b/boat-maven-plugin/src/it/example/boat-ship/src/main/resources/presentation-service-api/openapi.yaml @@ -0,0 +1,885 @@ +openapi: 3.0.3 +info: + title: Wallet Test Service API + description: No description available + version: 2.19.0 +servers: +- url: /artifact-service/ + description: The server +tags: +- name: wallet test service api +paths: + /service-api/v1/wallet/admin/{userId}/paymentcards: + summary: Payment Cards + description: No description available + get: + tags: + - wallet + summary: "Returns available payment card details for user, optionally filtered\ + \ by nameOnCard." + description: "Returns available payment card details for user, optionally filtered\ + \ by nameOnCard" + operationId: getPaymentCards + parameters: + - name: nameOnCard + in: query + description: "Filter by the cardholder's name (case-insensitive), can be the\ + \ first one or more characters of one of the words/names" + required: false + schema: + type: string + examples: + example: + summary: example + value: Smi + - name: dateTimeOnly + in: query + description: Creation date in datetime-only format + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 2017-10-04T14:54:36 + - name: dateTime + in: query + description: Creation date in Zoned RFC3339 Date-time format + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 2017-10-04T14:54:36Z + - name: dateTime2616 + in: query + description: Zoned RFC2616 Date-time param example + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: "Wed, 4 Jul 2001 12:08:56 PDT" + - name: date + in: query + description: Date-only param example + required: false + schema: + type: string + format: date + examples: + example: + summary: example + value: 2017-10-04 + - name: time + in: query + description: time-only param example + required: false + schema: + type: string + format: date-time + examples: + example: + summary: example + value: 14:54:36 + - name: orderBy + in: query + description: "Order by field: nameOnCard\n" + required: false + schema: + type: string + examples: + example: + summary: example + - name: direction + in: query + description: Direction + required: false + schema: + type: string + default: DESC + enum: + - ASC + - DESC + examples: + example: + summary: example + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCards' + examples: + example: + value: "[ {\n \"id\" : \"a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1\"\ + ,\n \"pan\" : \"5434111122223333\",\n \"cvc\" : \"123\",\n \ + \ \"startDate\" : \"0116\",\n \"expiryDate\" : \"1219\",\n \"\ + nameOnCard\" : \"Mr Timmy Tester\",\n \"creationDate\" : \"2011-05-30T12:13:14+03:00\"\ + ,\n \"balance\" : {\n \"amount\" : \"2001\",\n \"currencyCode\"\ + \ : \"EUR\"\n },\n \"apr\" : 12.75\n}, {\n \"id\" : \"d593c212-70ad-41a6-a547-d5d9232414cb\"\ + ,\n \"pan\" : \"5434111122224444\",\n \"cvc\" : \"101\",\n \ + \ \"startDate\" : \"0216\",\n \"expiryDate\" : \"0120\",\n \"\ + nameOnCard\" : \"Mr Timmothy Tester\",\n \"creationDate\" : \"\ + 2011-05-30T12:13:14+03:00\",\n \"balance\" : {\n \"amount\"\ + \ : \"4.4399999999999995\",\n \"currencyCode\" : \"GBP\"\n\ + \ },\n \"apr\" : 12.75\n}, {\n \"id\" : \"9635966b-28e9-4479-8121-bb7bc9beeb62\"\ + ,\n \"pan\" : \"5434121212121212\",\n \"cvc\" : \"121\",\n \ + \ \"startDate\" : \"0115\",\n \"expiryDate\" : \"1218\",\n \"\ + nameOnCard\" : \"Mr Timmy Tester\",\n \"creationDate\" : \"2011-05-30T12:13:14+03:00\"\ + ,\n \"balance\" : {\n \"amount\" : \"1981\",\n \"currencyCode\"\ + \ : \"EUR\"\n },\n \"apr\" : 12.75\n} ]" + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: "{\n \"message\" : \"Bad Request\",\n \"errors\" : [ {\n\ + \ \"message\" : \"Value Exceeded. Must be between {min} and\ + \ {max}.\",\n \"key\" : \"common.api.shoesize\",\n \"context\"\ + \ : {\n \"max\" : \"50\",\n \"min\" : \"1\"\n }\n\ + \ } ]\n}" + "406": + description: NotAcceptable + content: + application/json: + schema: + $ref: '#/components/schemas/NotAcceptableError' + examples: + example: + value: "{\n \"message\" : \"Could not find acceptable representation\"\ + ,\n \"supportedMediaTypes\" : [ \"application/json\" ]\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to an insufficient user quota of {quota}.\",\n \"key\"\ + \ : \"common.api.quota\",\n \"context\" : {\n \"quota\"\ + \ : \"someQuota\"\n }\n } ]\n}" + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: "{\n \"message\" : \"Unsupported media type.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"The request entity has a media type\ + \ {mediaType} which the resource does not support.\",\n \"\ + key\" : \"common.api.mediaType\",\n \"context\" : {\n \ + \ \"mediaType\" : \"application/javascript\"\n }\n } ]\n}" + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: "{\n \"message\" : \"Resource not found.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"Unable to find the resource requested\ + \ resource: {resource}.\",\n \"key\" : \"common.api.resource\"\ + ,\n \"context\" : {\n \"resource\" : \"aResource\"\n \ + \ }\n } ]\n}" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to invalid credentials.\",\n \"key\" : \"common.api.token\"\ + ,\n \"context\" : {\n \"accessToken\" : \"expired\"\n\ + \ }\n } ]\n}" + post: + tags: + - wallet + summary: Adds a payment card to the user's wallet. + description: Adds a payment card to the user's wallet + operationId: postPaymentCards + parameters: + - name: X-Request-Id + in: header + description: Correlates HTTP requests between a client and server. + required: false + schema: + type: string + examples: + example: + summary: example + value: f058ebd6-02f7-4d3f-942e-904344e8cde5 + requestBody: + description: Adds a payment card to the user's wallet + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCard' + examples: + example: + value: "{\n \"id\" : \"a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1\",\n\ + \ \"pan\" : \"5434111122223333\",\n \"cvc\" : \"123\",\n \"startDate\"\ + \ : \"0116\",\n \"expiryDate\" : \"1219\",\n \"nameOnCard\" :\ + \ \"Mr Timmy Tester\",\n \"creationDate\" : \"2011-05-30T12:13:14+03:00\"\ + ,\n \"balance\" : {\n \"amount\" : \"1000\",\n \"currencyCode\"\ + \ : \"EUR\"\n },\n \"apr\" : 12.75\n}" + responses: + "201": + description: request to create payment card accepted + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCardsPostResponseBody' + examples: + example: + value: "{\n \"id\" : \"a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1\"\n\ + }" + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: "{\n \"message\" : \"Bad Request\",\n \"errors\" : [ {\n\ + \ \"message\" : \"Value Exceeded. Must be between {min} and\ + \ {max}.\",\n \"key\" : \"common.api.shoesize\",\n \"context\"\ + \ : {\n \"max\" : \"50\",\n \"min\" : \"1\"\n }\n\ + \ } ]\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to an insufficient user quota of {quota}.\",\n \"key\"\ + \ : \"common.api.quota\",\n \"context\" : {\n \"quota\"\ + \ : \"someQuota\"\n }\n } ]\n}" + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: "{\n \"message\" : \"Unsupported media type.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"The request entity has a media type\ + \ {mediaType} which the resource does not support.\",\n \"\ + key\" : \"common.api.mediaType\",\n \"context\" : {\n \ + \ \"mediaType\" : \"application/javascript\"\n }\n } ]\n}" + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: "{\n \"message\" : \"Resource not found.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"Unable to find the resource requested\ + \ resource: {resource}.\",\n \"key\" : \"common.api.resource\"\ + ,\n \"context\" : {\n \"resource\" : \"aResource\"\n \ + \ }\n } ]\n}" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to invalid credentials.\",\n \"key\" : \"common.api.token\"\ + ,\n \"context\" : {\n \"accessToken\" : \"expired\"\n\ + \ }\n } ]\n}" + parameters: + - name: userId + in: path + description: No description available + required: true + schema: + type: string + examples: + example: + summary: example + /service-api/v1/wallet/admin/{userId}/paymentcards/{cardId}: + summary: Payment Card + description: No description available + get: + tags: + - wallet + summary: Returns details of a specific payment card. + description: Returns details of a specific payment card + operationId: getPaymentCard + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentCard' + examples: + example: + value: "{\n \"id\" : \"a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1\",\n\ + \ \"pan\" : \"5434111122223333\",\n \"cvc\" : \"123\",\n \"\ + startDate\" : \"0116\",\n \"expiryDate\" : \"1219\",\n \"nameOnCard\"\ + \ : \"Mr Timmy Tester\",\n \"creationDate\" : \"2011-05-30T12:13:14+03:00\"\ + ,\n \"balance\" : {\n \"amount\" : \"1000\",\n \"currencyCode\"\ + \ : \"EUR\"\n },\n \"apr\" : 12.75\n}" + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: "{\n \"message\" : \"Bad Request\",\n \"errors\" : [ {\n\ + \ \"message\" : \"Value Exceeded. Must be between {min} and\ + \ {max}.\",\n \"key\" : \"common.api.shoesize\",\n \"context\"\ + \ : {\n \"max\" : \"50\",\n \"min\" : \"1\"\n }\n\ + \ } ]\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to an insufficient user quota of {quota}.\",\n \"key\"\ + \ : \"common.api.quota\",\n \"context\" : {\n \"quota\"\ + \ : \"someQuota\"\n }\n } ]\n}" + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: "{\n \"message\" : \"Unsupported media type.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"The request entity has a media type\ + \ {mediaType} which the resource does not support.\",\n \"\ + key\" : \"common.api.mediaType\",\n \"context\" : {\n \ + \ \"mediaType\" : \"application/javascript\"\n }\n } ]\n}" + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: "{\n \"message\" : \"Resource not found.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"Unable to find the resource requested\ + \ resource: {resource}.\",\n \"key\" : \"common.api.resource\"\ + ,\n \"context\" : {\n \"resource\" : \"aResource\"\n \ + \ }\n } ]\n}" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to invalid credentials.\",\n \"key\" : \"common.api.token\"\ + ,\n \"context\" : {\n \"accessToken\" : \"expired\"\n\ + \ }\n } ]\n}" + delete: + tags: + - wallet + summary: Deletes a payment card with a given id. + description: Deletes a payment card with a given id + operationId: deletePaymentCard + responses: + "204": + description: Payment card is succesfully deleted + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: "{\n \"message\" : \"Bad Request\",\n \"errors\" : [ {\n\ + \ \"message\" : \"Value Exceeded. Must be between {min} and\ + \ {max}.\",\n \"key\" : \"common.api.shoesize\",\n \"context\"\ + \ : {\n \"max\" : \"50\",\n \"min\" : \"1\"\n }\n\ + \ } ]\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to an insufficient user quota of {quota}.\",\n \"key\"\ + \ : \"common.api.quota\",\n \"context\" : {\n \"quota\"\ + \ : \"someQuota\"\n }\n } ]\n}" + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: "{\n \"message\" : \"Unsupported media type.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"The request entity has a media type\ + \ {mediaType} which the resource does not support.\",\n \"\ + key\" : \"common.api.mediaType\",\n \"context\" : {\n \ + \ \"mediaType\" : \"application/javascript\"\n }\n } ]\n}" + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: "{\n \"message\" : \"Resource not found.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"Unable to find the resource requested\ + \ resource: {resource}.\",\n \"key\" : \"common.api.resource\"\ + ,\n \"context\" : {\n \"resource\" : \"aResource\"\n \ + \ }\n } ]\n}" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to invalid credentials.\",\n \"key\" : \"common.api.token\"\ + ,\n \"context\" : {\n \"accessToken\" : \"expired\"\n\ + \ }\n } ]\n}" + parameters: + - name: cardId + in: path + description: No description available + required: true + schema: + type: string + examples: + example: + summary: example + - name: userId + in: path + description: No description available + required: true + schema: + type: string + examples: + example: + summary: example + /service-api/v1/testQuery/required-boolean-query-param: + summary: required boolean query param + description: arbitrary tests + get: + tags: + - testQuery + description: No description available + operationId: getrequiredBooleanQueryParam + parameters: + - name: bool + in: query + description: Required boolean parameter with no default value + required: true + schema: + type: boolean + examples: + example: + summary: example + value: false + responses: + "200": + description: No description available + content: + application/json: + schema: + $ref: '#/components/schemas/RequiredbooleanqueryparamGetResponseBody' + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + examples: + example: + value: "{\n \"message\" : \"Bad Request\",\n \"errors\" : [ {\n\ + \ \"message\" : \"Value Exceeded. Must be between {min} and\ + \ {max}.\",\n \"key\" : \"common.api.shoesize\",\n \"context\"\ + \ : {\n \"max\" : \"50\",\n \"min\" : \"1\"\n }\n\ + \ } ]\n}" + "500": + description: InternalServerError + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + examples: + example: + value: "{\n \"message\" : \"Description of error\"\n}" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to an insufficient user quota of {quota}.\",\n \"key\"\ + \ : \"common.api.quota\",\n \"context\" : {\n \"quota\"\ + \ : \"someQuota\"\n }\n } ]\n}" + "415": + description: UnsupportedMediaType + content: + application/json: + schema: + $ref: '#/components/schemas/UnsupportedMediaTypeError' + examples: + example: + value: "{\n \"message\" : \"Unsupported media type.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"The request entity has a media type\ + \ {mediaType} which the resource does not support.\",\n \"\ + key\" : \"common.api.mediaType\",\n \"context\" : {\n \ + \ \"mediaType\" : \"application/javascript\"\n }\n } ]\n}" + "404": + description: NotFound + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + examples: + example: + value: "{\n \"message\" : \"Resource not found.\",\n \"errors\"\ + \ : [ {\n \"message\" : \"Unable to find the resource requested\ + \ resource: {resource}.\",\n \"key\" : \"common.api.resource\"\ + ,\n \"context\" : {\n \"resource\" : \"aResource\"\n \ + \ }\n } ]\n}" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedAltError' + examples: + example: + value: "{\n \"message\" : \"Access to requested resource denied.\"\ + ,\n \"errors\" : [ {\n \"message\" : \"Resource access denied\ + \ due to invalid credentials.\",\n \"key\" : \"common.api.token\"\ + ,\n \"context\" : {\n \"accessToken\" : \"expired\"\n\ + \ }\n } ]\n}" +components: + schemas: + BadRequestError: + required: + - message + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + BbAccessControl: + required: + - function + - privilege + - resource + type: object + properties: + resource: + type: string + description: "Resource being protected, e.g. 'User'" + function: + type: string + description: "Business function, e.g. 'Manage Users'" + privilege: + type: string + description: "The privilege required, e.g. 'view'" + BbApiDeprecation: + required: + - deprecatedFromVersion + - description + - reason + - removedFromVersion + type: object + properties: + deprecatedFromVersion: + type: string + description: Version of the product from which the endpoint has been deprecated + and should no longer be used + deprecated: true + removedFromVersion: + type: string + description: Version of the product from which the API endpoint will be + removed + reason: + type: string + description: The reason the API endpoint was deprecated + deprecated: true + description: + type: string + description: "Any further information, e.g. migration information" + Currency: + title: Monetary Amount + required: + - amount + - currencyCode + type: object + properties: + amount: + type: string + description: The amount in the specified currency + currencyCode: + pattern: "^[A-Z]{3}$" + type: string + description: The alpha-3 code (complying with ISO 4217) of the currency + that qualifies the amount + description: Schema defining monetary amount in given currency. + ErrorItem: + type: object + properties: + message: + type: string + description: Default Message. Any further information. + key: + type: string + description: "{capability-name}.api.{api-key-name}. For generated validation\ + \ errors this is the path in the document the error resolves to. e.g.\ + \ object name + '.' + field" + context: + type: object + description: Context can be anything used to construct localised messages. + description: A validation error + ForbiddenError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + InternalServerError: + required: + - message + type: object + properties: + message: + type: string + description: Further Information + description: Represents HTTP 500 Internal Server Error + NotAcceptableError: + type: object + properties: + message: + type: string + supportedMediaTypes: + type: array + description: List of supported media types for this endpoint + items: + type: string + NotFoundError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + ObjectWrappingException: + type: object + properties: + message: + type: string + data: + type: object + PaymentCard: + required: + - cvc + - expiryDate + - id + - nameOnCard + - pan + - startDate + type: object + properties: + id: + type: string + pan: + maxLength: 19 + type: string + description: "Must be sixteen digits, optionally in blocks of 4 separated\ + \ by a dash" + cvc: + maxLength: 3 + minLength: 3 + type: string + description: Card Verification Code + startDate: + pattern: "^(0[1-9]|1[0-2])/?([0-9]{4}|[0-9]{2})$" + type: string + description: "Must be in one of these four formats: MM/YY MMYY MMYYYY MM/YYYY" + expiryDate: + pattern: "^(0[1-9]|1[0-2])/?([0-9]{4}|[0-9]{2})$" + type: string + description: "Must be in one of these four formats: MM/YY MMYY MMYYYY MM/YYYY" + nameOnCard: + type: string + creationDate: + type: string + format: date-time + balance: + $ref: '#/components/schemas/Currency' + apr: + type: number + cardtype: + type: string + enum: + - CREDIT + - DEBIT + - PREPAID + PaymentCards: + type: array + items: + $ref: '#/components/schemas/PaymentCard' + PaymentCardsPostResponseBody: + type: object + properties: + id: + type: string + example: + id: a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1 + RequiredbooleanqueryparamGetResponseBody: + type: object + properties: + message: + type: string + TestHeadersResponseBody: + type: object + properties: + requests: + type: array + items: + type: object + properties: + name: + type: string + url: + type: string + headers: + type: object + UnauthorizedAltError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' + UnauthorizedError: + required: + - message + type: object + properties: + message: + type: string + UnsupportedMediaTypeError: + type: object + properties: + message: + type: string + description: Any further information + errors: + type: array + description: Detailed error information + items: + $ref: '#/components/schemas/ErrorItem' diff --git a/boat-maven-plugin/src/it/example/invoker.properties b/boat-maven-plugin/src/it/example/invoker.properties index 3c10d00c2..58e0cdc7b 100644 --- a/boat-maven-plugin/src/it/example/invoker.properties +++ b/boat-maven-plugin/src/it/example/invoker.properties @@ -1 +1 @@ -invoker.goals.1=verify +invoker.goals.1=verify \ No newline at end of file diff --git a/boat-maven-plugin/src/it/example/pom.xml b/boat-maven-plugin/src/it/example/pom.xml index 58f0aa68f..71fe230ab 100644 --- a/boat-maven-plugin/src/it/example/pom.xml +++ b/boat-maven-plugin/src/it/example/pom.xml @@ -40,6 +40,8 @@ BOAT :: Examples + boat-ship + boat-bundle-ship boat-multiple-executions boat-artifact-input boat-doc diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/BundleMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/BundleMojo.java index fd105a2ea..6345c8a33 100644 --- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/BundleMojo.java +++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/BundleMojo.java @@ -4,6 +4,7 @@ import static java.util.Collections.singletonMap; import static org.apache.commons.collections4.CollectionUtils.isNotEmpty; import static org.apache.commons.lang3.StringUtils.isNotBlank; +import static org.apache.commons.lang3.StringUtils.isNumeric; import com.backbase.oss.boat.loader.OpenAPILoader; import com.backbase.oss.boat.loader.OpenAPILoaderException; @@ -18,6 +19,8 @@ import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.util.List; +import java.util.stream.Collectors; + import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -27,6 +30,7 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; +import org.codehaus.plexus.util.DirectoryScanner; @Mojo(name = "bundle", requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe = true) @Slf4j @@ -37,13 +41,13 @@ @Setter public class BundleMojo extends AbstractMojo { - @Parameter(name = "input", required = true) + @Parameter(name = "input", required = true, defaultValue = "${project.basedir}/src/main/resources") private File input; - @Parameter(name = "includes", required = false, defaultValue = "*.yaml") - private String includes; + @Parameter(name = "includes", defaultValue = "**/openapi.yaml, **/*api*.yaml") + protected String[] includes; - @Parameter(name = "output", required = true) + @Parameter(name = "output", required = true, defaultValue = "${project.build.directory}/openapi") private File output; @Parameter(name = "version", required = false) @@ -65,7 +69,6 @@ public class BundleMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { getLog().info("Skipping OpenAPI bundle."); - return; } @@ -78,18 +81,14 @@ public void execute() throws MojoExecutionException, MojoFailureException { final File[] inputFiles; final File[] outputFiles; if (input.isDirectory()) { - String[] inputs; - try { - inputs = Utils.selectInputs(input.toPath(), includes); - } catch (IOException e) { - throw new MojoExecutionException("Cannot scan input " + input, e); - } - - inputFiles = stream(inputs) - .map(file -> new File(input, file)) - .toArray(File[]::new); - outputFiles = stream(inputs) + DirectoryScanner directoryScanner = new DirectoryScanner(); + directoryScanner.setBasedir(input); + directoryScanner.setIncludes(includes); + directoryScanner.scan(); + String[] includedFiles = directoryScanner.getIncludedFiles(); + inputFiles = stream(includedFiles).map(f -> new File(input, f)).collect(Collectors.toList()).toArray(File[]::new); + outputFiles = stream(includedFiles) .map(file -> new File(output, file)) .toArray(File[]::new); @@ -107,6 +106,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { private void bundleOpenAPI(File inputFile, File outputFile) throws MojoExecutionException { try { + log.info("Bundling {} into a single OpenAPI file: {}", inputFile, outputFile); OpenAPI openAPI = OpenAPILoader.load(inputFile); if (isNotBlank(version)) { @@ -132,6 +132,7 @@ private void bundleOpenAPI(File inputFile, File outputFile) throws MojoExecution } Files.write(outputFile.toPath(), SerializerUtils.toYamlString(openAPI).getBytes(), StandardOpenOption.CREATE); + log.info("Bundled: {} into: {}", inputFile, outputFile); } catch (OpenAPILoaderException | IOException e) { throw new MojoExecutionException("Error transforming OpenAPI: {}" + inputFile, e); } diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/ShipMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/ShipMojo.java new file mode 100644 index 000000000..8afd3a0fa --- /dev/null +++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/ShipMojo.java @@ -0,0 +1,114 @@ +package com.backbase.oss.boat; + +import lombok.Getter; +import lombok.Setter; +import lombok.extern.slf4j.Slf4j; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.MavenProjectHelper; +import org.codehaus.plexus.archiver.util.DefaultFileSet; +import org.codehaus.plexus.archiver.zip.ZipArchiver; +import org.codehaus.plexus.util.DirectoryScanner; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; + +import static java.util.Arrays.stream; + +/** + Zips all API's and attach it to the the Maven Project Reactor for publishing + */ +@Mojo(name = "ship", requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe = true) +@Slf4j +@Getter +@Setter +public class ShipMojo extends AbstractMojo { + + @Component + protected MavenProjectHelper projectHelper; + + + @Parameter(name = "input", required = true, defaultValue = "${project.basedir}/src/main/resources") + protected File input; + + @Parameter(name = "includes", defaultValue = "**/openapi.yaml, **/*api*.yaml") + protected String[] includes; + + @Parameter(name = "project", defaultValue = "${project}", readonly = true) + protected MavenProject project; + + @Parameter(defaultValue = "${project.build.finalName}") + private String finalName; + + @Parameter(defaultValue = "${project.basedir}") + private File baseDir; + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + final String[] inputFiles; + if (input.isDirectory()) { + log.info("Scanning directory: {} with include patterns: {}", input, includes); + DirectoryScanner directoryScanner = new DirectoryScanner(); + directoryScanner.setBasedir(input); + directoryScanner.setIncludes(includes); + directoryScanner.scan(); + inputFiles = directoryScanner.getIncludedFiles(); + if(inputFiles.length == 0) { + throw new MojoExecutionException("No API's found in directory: " + input + " with include patterns: " + Arrays.toString(includes)); + } + log.info("Found " + inputFiles.length + " specs to sip"); + } else { + inputFiles = new String[]{input.toPath().relativize(project.getBasedir().toPath()).toString()}; + } + + try { + File apiZipFile = zip(inputFiles); + log.info("Attaching API's to project reactor as {} ready to ship!", apiZipFile); + projectHelper.attachArtifact(project, "zip", "api",apiZipFile); + } catch (IOException e) { + throw new MojoExecutionException("Failed to zip files due to: " + e.getMessage(), e); + } + } + + private File zip(String[] inputFiles) throws IOException { + File api = createFileName(new File(project.getBuild().getOutputDirectory()), finalName, "api"); + log.info("Zipping OpenApi Files: {} to: {}", inputFiles, api); + + DefaultFileSet fileSet = new DefaultFileSet(); + fileSet.setDirectory(input); + fileSet.setUsingDefaultExcludes(true); + fileSet.setIncludes(inputFiles); + + ZipArchiver zipArchiver = new ZipArchiver(); + zipArchiver.addFileSet(fileSet); + zipArchiver.setDestFile(api); + zipArchiver.createArchive(); + return zipArchiver.getDestFile(); + } + + /** + * Returns the Zip file to generate with classifier to be attached to the project + * + * @param basedir the output directory + * @param resultFinalName the name of the file + * @param classifier an optional classifier + * @return the file to generate + */ + public static File createFileName(File basedir, String resultFinalName, String classifier) { + if (basedir == null) { + throw new IllegalArgumentException("basedir is not allowed to be null"); + } + if (resultFinalName == null) { + throw new IllegalArgumentException("finalName is not allowed to be null"); + } + String fileName = resultFinalName + "-" + classifier + ".zip"; + return new File(basedir, fileName); + } +} diff --git a/boat-maven-plugin/src/test/java/com/backbase/oss/boat/BundleMojoTest.java b/boat-maven-plugin/src/test/java/com/backbase/oss/boat/BundleMojoTest.java index a300f855a..1d14699de 100644 --- a/boat-maven-plugin/src/test/java/com/backbase/oss/boat/BundleMojoTest.java +++ b/boat-maven-plugin/src/test/java/com/backbase/oss/boat/BundleMojoTest.java @@ -22,7 +22,8 @@ class BundleMojoTest { @Test @SneakyThrows - void testInputDirectoryAndOutputFile() { + void + testInputDirectoryAndOutputFile() { BundleMojo mojo = new BundleMojo(); mojo.setInput(new File(".")); mojo.setOutput(new File("target/testInputDirectoryAndOutputFile.yaml")); @@ -52,7 +53,7 @@ void testBundleFolder() { mojo.setInput(new File(getClass().getResource("/bundler/folder/one-client-api-v1.yaml").getFile()) .getParentFile()); mojo.setOutput(new File("target/test-bundle-folder")); - mojo.setIncludes("*-api-v*.yaml"); + mojo.setIncludes(new String[]{"*-api-v*.yaml"}); mojo.setVersionFileName(true); mojo.execute(); diff --git a/boat-maven-plugin/src/test/java/com/backbase/oss/boat/ShipMojoTests.java b/boat-maven-plugin/src/test/java/com/backbase/oss/boat/ShipMojoTests.java new file mode 100644 index 000000000..3dc66a369 --- /dev/null +++ b/boat-maven-plugin/src/test/java/com/backbase/oss/boat/ShipMojoTests.java @@ -0,0 +1,61 @@ +package com.backbase.oss.boat; + +import org.apache.maven.model.Build; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.MavenProjectHelper; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; + +class ShipMojoTests { + + @Test + void testInputDirectoryAndOutputFile() { + ShipMojo mojo = new ShipMojo(); + MavenProject mavenProject = new MavenProject(); + Build build = new Build(); + build.setFinalName("api-1.0-SNAPSHOT"); + build.setOutputDirectory("target"); + mavenProject.setBuild(build); + + mojo.setFinalName("petstore-1.0-SNAPSHOT"); + File parentFile = new File(getClass().getResource("/bundler/folder/one-client-api-v1.yaml").getFile()).getParentFile(); + mojo.setInput(parentFile); + mojo.setIncludes(new String[]{"**/*.yaml"}); + mojo.setBaseDir(parentFile); + mojo.setProject(mavenProject); + mojo.setProjectHelper(new MavenProjectHelper() { + @Override + public void attachArtifact(MavenProject project, File artifactFile, String artifactClassifier) { + + } + + @Override + public void attachArtifact(MavenProject project, String artifactType, File artifactFile) { + + } + + @Override + public void attachArtifact(MavenProject project, String artifactType, String artifactClassifier, File artifactFile) { + + } + + @Override + public void addResource(MavenProject project, String resourceDirectory, List includes, List excludes) { + + } + + @Override + public void addTestResource(MavenProject project, String resourceDirectory, List includes, List excludes) { + + } + }); + mojo.setInput(new File(".")); + assertDoesNotThrow(mojo::execute); + } + + +} diff --git a/boat-quay/boat-quay-lint/pom.xml b/boat-quay/boat-quay-lint/pom.xml index e6474a89a..017f87c3b 100644 --- a/boat-quay/boat-quay-lint/pom.xml +++ b/boat-quay/boat-quay-lint/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss boat-quay - 0.14.5 + 0.14.6-SNAPSHOT boat-quay-lint jar diff --git a/boat-quay/boat-quay-rules/pom.xml b/boat-quay/boat-quay-rules/pom.xml index f3f8d2eda..d7bbc1409 100644 --- a/boat-quay/boat-quay-rules/pom.xml +++ b/boat-quay/boat-quay-rules/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss boat-quay - 0.14.5 + 0.14.6-SNAPSHOT boat-quay-rules jar diff --git a/boat-quay/pom.xml b/boat-quay/pom.xml index 1cb9c5181..ff20a8e92 100644 --- a/boat-quay/pom.xml +++ b/boat-quay/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.14.5 + 0.14.6-SNAPSHOT diff --git a/boat-scaffold/pom.xml b/boat-scaffold/pom.xml index ad7ad2c30..3fe3cef5b 100644 --- a/boat-scaffold/pom.xml +++ b/boat-scaffold/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.14.5 + 0.14.6-SNAPSHOT boat-scaffold @@ -86,7 +86,7 @@ com.backbase.oss boat-trail-resources - 0.14.5 + 0.14.6-SNAPSHOT test diff --git a/boat-scaffold/src/main/java/com/backbase/oss/codegen/BoatStaticDocsGenerator.java b/boat-scaffold/src/main/java/com/backbase/oss/codegen/BoatStaticDocsGenerator.java index f801e35fe..e1ee165e2 100644 --- a/boat-scaffold/src/main/java/com/backbase/oss/codegen/BoatStaticDocsGenerator.java +++ b/boat-scaffold/src/main/java/com/backbase/oss/codegen/BoatStaticDocsGenerator.java @@ -2,11 +2,13 @@ import com.backbase.oss.codegen.doc.BoatCodegenParameter; import com.backbase.oss.codegen.doc.BoatCodegenResponse; +import com.backbase.oss.codegen.doc.BoatExample; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectReader; import com.fasterxml.jackson.databind.node.ArrayNode; import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.examples.Example; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; @@ -21,10 +23,7 @@ import java.io.IOException; import java.nio.charset.Charset; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; @Slf4j @@ -65,6 +64,13 @@ public void preprocessOpenAPI(OpenAPI openAPI) { .collect(Collectors.toList())); } + if (openAPI.getComponents().getExamples() != null) { + Set imports = new HashSet<>(); + additionalProperties.put("examples", openAPI.getComponents().getExamples().entrySet().stream() + .map(exampleEntry -> mapComponentExample(imports, exampleEntry)) + .collect(Collectors.toList())); + } + if (openAPI.getPaths() != null) // Ensure single tags for operations openAPI.getPaths().forEach((path, pathItem) -> @@ -84,6 +90,12 @@ private CodegenParameter mapComponentRequestBody(Set imports, java.util. return fromRequestBody(requestBody, imports, name); } + private BoatExample mapComponentExample(Set imports, Map.Entry namedExample) { + String key = namedExample.getKey(); + Example example = namedExample.getValue(); + return new BoatExample(key,"", example , false); + } + private CodegenParameter mapComponentParameter(Set imports, java.util.Map.Entry nameParameter) { Parameter parameter = nameParameter.getValue(); return fromParameter(parameter, imports); diff --git a/boat-scaffold/src/main/templates/boat-angular/api.service.mustache b/boat-scaffold/src/main/templates/boat-angular/api.service.mustache index e8bb05843..3adf3afe0 100644 --- a/boat-scaffold/src/main/templates/boat-angular/api.service.mustache +++ b/boat-scaffold/src/main/templates/boat-angular/api.service.mustache @@ -109,6 +109,7 @@ export class {{classname}} { } {{#operation}} +{{#produces}} /** {{#summary}} * {{summary}} @@ -125,11 +126,58 @@ export class {{classname}} { * @deprecated This endpoint is deprecated {{/isDeprecated}} */ -{{#produces}} public {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: '{{mediaType}}'}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>; + /** +{{#summary}} + * {{summary}} +{{/summary}} +{{#notes}} + * {{notes}} +{{/notes}} + {{#allParams.0}} + * @param requestParameters + {{/allParams.0}} + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + {{#isDeprecated}} + * @deprecated This endpoint is deprecated + {{/isDeprecated}} + */ public {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: '{{mediaType}}'}): Observable>; + /** +{{#summary}} + * {{summary}} +{{/summary}} +{{#notes}} + * {{notes}} +{{/notes}} + {{#allParams.0}} + * @param requestParameters + {{/allParams.0}} + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + {{#isDeprecated}} + * @deprecated This endpoint is deprecated + {{/isDeprecated}} + */ public {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: '{{mediaType}}'}): Observable>; {{/produces}} + /** +{{#summary}} + * {{summary}} +{{/summary}} +{{#notes}} + * {{notes}} +{{/notes}} + {{#allParams.0}} + * @param requestParameters + {{/allParams.0}} + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + {{#isDeprecated}} + * @deprecated This endpoint is deprecated + {{/isDeprecated}} + */ public {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: {{#produces}}'{{mediaType}}'{{#hasMore}} | {{/hasMore}}{{/produces}}{{^produces}}undefined{{/produces}}}): Observable { {{#allParams}} const _{{paramName}} = requestParameters["{{paramName}}"]; diff --git a/boat-scaffold/src/main/templates/boat-marina/api.js.handlebars b/boat-scaffold/src/main/templates/boat-marina/api.js.handlebars index 02e7f2ab6..1b121a32a 100644 --- a/boat-scaffold/src/main/templates/boat-marina/api.js.handlebars +++ b/boat-scaffold/src/main/templates/boat-marina/api.js.handlebars @@ -4,6 +4,7 @@ const data = { appDescription: {{json appDescription}}, operations: [], models: {}, + examples: {}, requestBodies: {}, responses: {}, parameters: {}, @@ -28,6 +29,12 @@ const data = { {{/with}} {{/each}} +{{#each examples as |example|}} + {{#with example}} + data.examples["{{name}}"] = {{json .}} + {{/with}} +{{/each}} + {{#each requestBodies}} data["requestBodies"]["{{baseName}}"] = {{{jsonSchema}}}; {{/each}} @@ -48,3 +55,4 @@ const data = { +module.exports = { data }; \ No newline at end of file diff --git a/boat-terminal/pom.xml b/boat-terminal/pom.xml index 36bd6a3ce..226d9cef8 100644 --- a/boat-terminal/pom.xml +++ b/boat-terminal/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.14.5 + 0.14.6-SNAPSHOT boat-terminal diff --git a/boat-trail-resources/pom.xml b/boat-trail-resources/pom.xml index 2f5c36b5f..56167fa28 100644 --- a/boat-trail-resources/pom.xml +++ b/boat-trail-resources/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.14.5 + 0.14.6-SNAPSHOT boat-trail-resources diff --git a/pom.xml b/pom.xml index 526287591..305958ead 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.14.5 + 0.14.6-SNAPSHOT pom Backbase Open Api Tools will help you converting RAML to OpenAPI plus many more @@ -157,6 +157,12 @@ 3.1.0 + + org.codehaus.plexus + plexus-utils + 3.3.0 + + com.google.code.findbugs jsr305 @@ -394,8 +400,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 + 11 + 11 diff --git a/tests/pom.xml b/tests/pom.xml index b80b294bf..81759adc7 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.14.5 + 0.14.6-SNAPSHOT tests