diff --git a/README.md b/README.md
index bc97a9718..b8c13a1b0 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,11 @@ 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.3
+
+* *Maven Plugin*
+ * Added new goal `boat:transform`; see the description in the [plugin documentation](boat-maven-plugin/README.md#boattransform).
+
## 0.14.2
* *Angular Generator*
* Added support for Angular version ranges in peer dependencies
@@ -39,6 +44,7 @@ BOAT is still under development and subject to change.
* Check prefix for paths should contain version.
* Enabled rules.
* Use Standard HTTP Status Codes.
+
## 0.12.0
* *General*
* Improved code quality
@@ -140,13 +146,11 @@ BOAT is still under development and subject to change.
* ability to resolve references like #/components/schemas/myObject/items or #/components/schemas/myObject/properties/embeddedObject
* simple fix to avoid npe in StaticHtml2Generation escaping response message.
-
## 0.5.0
* Add DereferenceComponentsPropertiesTransformer (that does a bit extra)
* Fix recursive referencing in UnAliasTransformer
-
## 0.4.0
* Added bundle skip
* Changed numbering scheme
@@ -626,6 +630,7 @@ For the `spring` generator, the additional configuration options are:
| `useClassLevelBeanValidation` | Adds @Validated annotation to API interfaces (Default: false) |
| `useLombokAnnotations` | Use Lombok annotations to generate properties accessors and `hashCode`/`equals` methods (Default: false) |
| `addServletRequest` | Adds ServletRequest objects to API method definitions (Default: false) |
+| `addBindingResult` | Adds BindingResult to Api method definitions' request bodies if UseBeanValidation true, for this to be effective you must configure UseBeanValidation, this is not done automatically (Default: false)|
| `implicitHeaders` | Skip header parameters in the generated API methods using @ApiImplicitParams annotation. (Default: false) |
| `swaggerDocketConfig` | Generate Spring OpenAPI Docket configuration class. (Default: false) |
| `apiFirst` | Generate the API from the OAI spec at server compile time (API first approach) (Default: false) |
diff --git a/boat-engine/pom.xml b/boat-engine/pom.xml
index 6995811e2..d2db98496 100644
--- a/boat-engine/pom.xml
+++ b/boat-engine/pom.xml
@@ -5,7 +5,7 @@
com.backbase.ossbackbase-openapi-tools
- 0.14.2-SNAPSHOT
+ 0.14.3-SNAPSHOTboat-enginejar
diff --git a/boat-engine/src/main/java/com/backbase/oss/boat/loader/OpenAPILoader.java b/boat-engine/src/main/java/com/backbase/oss/boat/loader/OpenAPILoader.java
index 2b19e4773..fba68bf28 100644
--- a/boat-engine/src/main/java/com/backbase/oss/boat/loader/OpenAPILoader.java
+++ b/boat-engine/src/main/java/com/backbase/oss/boat/loader/OpenAPILoader.java
@@ -2,9 +2,12 @@
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.parser.OpenAPIV3Parser;
+import io.swagger.v3.parser.core.models.AuthorizationValue;
import io.swagger.v3.parser.core.models.ParseOptions;
import io.swagger.v3.parser.core.models.SwaggerParseResult;
import java.io.File;
+import java.util.List;
+
import lombok.extern.slf4j.Slf4j;
@Slf4j
@@ -55,6 +58,10 @@ public static OpenAPI load(File file, boolean resolveFully, boolean flatten) thr
}
public static OpenAPI load(String url, boolean resolveFully, boolean flatten) throws OpenAPILoaderException {
+ return load(url, resolveFully, flatten, null);
+ }
+
+ public static OpenAPI load(String url, boolean resolveFully, boolean flatten, List auth) throws OpenAPILoaderException {
log.debug("Reading OpenAPI from: {} resolveFully: {}", url, resolveFully);
OpenAPIV3Parser openAPIParser = new OpenAPIV3Parser();
ParseOptions parseOptions = new ParseOptions();
@@ -64,7 +71,7 @@ public static OpenAPI load(String url, boolean resolveFully, boolean flatten) th
parseOptions.setFlattenComposedSchemas(true);
parseOptions.setResolveCombinators(true);
- SwaggerParseResult swaggerParseResult = openAPIParser.readLocation(url, null, parseOptions);
+ SwaggerParseResult swaggerParseResult = openAPIParser.readLocation(url, auth, parseOptions);
if (swaggerParseResult.getOpenAPI() == null) {
log.error("Could not load OpenAPI from : {} \n{}", url, String.join("\t\n", swaggerParseResult.getMessages()));
throw new OpenAPILoaderException("Could not load open api from :" + url, swaggerParseResult.getMessages());
diff --git a/boat-engine/src/main/java/com/backbase/oss/boat/transformers/VendorExtensionFilter.java b/boat-engine/src/main/java/com/backbase/oss/boat/transformers/ExtensionFilter.java
similarity index 67%
rename from boat-engine/src/main/java/com/backbase/oss/boat/transformers/VendorExtensionFilter.java
rename to boat-engine/src/main/java/com/backbase/oss/boat/transformers/ExtensionFilter.java
index ef68d453e..af3993920 100644
--- a/boat-engine/src/main/java/com/backbase/oss/boat/transformers/VendorExtensionFilter.java
+++ b/boat-engine/src/main/java/com/backbase/oss/boat/transformers/ExtensionFilter.java
@@ -1,31 +1,51 @@
package com.backbase.oss.boat.transformers;
-import static java.util.Optional.ofNullable;
-import static java.util.Spliterators.spliteratorUnknownSize;
-import static java.util.stream.StreamSupport.stream;
-
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ContainerNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import java.util.Map;
import java.util.Spliterator;
import io.swagger.v3.core.util.Yaml;
import io.swagger.v3.oas.models.OpenAPI;
+import lombok.Getter;
import lombok.NonNull;
+import lombok.Setter;
import lombok.SneakyThrows;
+import static java.util.Collections.emptyList;
+import static java.util.Optional.ofNullable;
+import static java.util.Spliterators.spliteratorUnknownSize;
+import static java.util.stream.Collectors.toSet;
+import static java.util.stream.StreamSupport.stream;
+
@SuppressWarnings("java:S3740")
-public class VendorExtensionFilter implements Transformer {
+@Getter
+@Setter
+public class ExtensionFilter implements Transformer {
+
+ private List remove = emptyList();
@Override
public @NonNull OpenAPI transform(@NonNull OpenAPI openAPI, @NonNull Map options) {
- return ofNullable(options.get("remove"))
- .map(remove -> transform(openAPI, (Collection) remove))
- .orElse(openAPI);
+ List extensions = new ArrayList<>(remove);
+
+ ofNullable(options.get("remove"))
+ .map(Collection.class::cast)
+ .ifPresent(extensions::addAll);
+
+ extensions.addAll(
+ extensions.stream()
+ .filter(s -> !s.startsWith("x-"))
+ .map(s -> "x-" + s)
+ .collect(toSet()));
+
+ return extensions.isEmpty() ? openAPI : transform(openAPI, extensions);
}
@SneakyThrows
diff --git a/boat-engine/src/main/java/com/backbase/oss/boat/transformers/SpecVersionTransformer.java b/boat-engine/src/main/java/com/backbase/oss/boat/transformers/SetVersion.java
similarity index 51%
rename from boat-engine/src/main/java/com/backbase/oss/boat/transformers/SpecVersionTransformer.java
rename to boat-engine/src/main/java/com/backbase/oss/boat/transformers/SetVersion.java
index 2d7c452c4..e525a3900 100644
--- a/boat-engine/src/main/java/com/backbase/oss/boat/transformers/SpecVersionTransformer.java
+++ b/boat-engine/src/main/java/com/backbase/oss/boat/transformers/SetVersion.java
@@ -2,17 +2,24 @@
import java.util.Map;
-import static java.util.Optional.*;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
+import lombok.Setter;
-@RequiredArgsConstructor
-public class SpecVersionTransformer implements Transformer {
+import static java.util.Optional.ofNullable;
+
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+public class SetVersion implements Transformer {
@NonNull
- private final String version;
+ private String version;
@Override
public OpenAPI transform(OpenAPI openAPI, Map options) {
@@ -25,6 +32,12 @@ public OpenAPI transform(OpenAPI openAPI, Map options) {
return openAPI;
}
-}
+ /**
+ * Default setter, used at creation from POM configuration.
+ */
+ public void set(String version) {
+ setVersion(version);
+ }
+}
diff --git a/boat-engine/src/test/java/com/backbase/oss/boat/transformers/VendorExtensionFilterTests.java b/boat-engine/src/test/java/com/backbase/oss/boat/transformers/ExtensionFilterTests.java
similarity index 92%
rename from boat-engine/src/test/java/com/backbase/oss/boat/transformers/VendorExtensionFilterTests.java
rename to boat-engine/src/test/java/com/backbase/oss/boat/transformers/ExtensionFilterTests.java
index 8c28e5d15..dfec5883e 100644
--- a/boat-engine/src/test/java/com/backbase/oss/boat/transformers/VendorExtensionFilterTests.java
+++ b/boat-engine/src/test/java/com/backbase/oss/boat/transformers/ExtensionFilterTests.java
@@ -17,11 +17,11 @@
import org.junit.jupiter.api.Test;
@Slf4j
-class VendorExtensionFilterTests {
+class ExtensionFilterTests {
@Test
void run() throws Throwable {
- Transformer trn = new VendorExtensionFilter();
+ Transformer trn = new ExtensionFilter();
OpenAPI api1 = OpenAPILoader.load(new File("src/test/resources/openapi/extension-filter/openapi.yaml"));
OpenAPI api2 = trn.transform(api1, singletonMap("remove", singleton("x-remove")));
diff --git a/boat-maven-plugin/README.md b/boat-maven-plugin/README.md
index b3ab2938f..baa931737 100644
--- a/boat-maven-plugin/README.md
+++ b/boat-maven-plugin/README.md
@@ -3,188 +3,189 @@
The `boat` plugin has multiple goals:
-- `export`
+## boat:export
- Generates client/server code from a OpenAPI json/yaml
- definition. Finds files name `api.raml`, `client-api.raml` or `service-api.raml`. Processes these files (and the
- json schemes they refer to) to produce `open-api.yaml` files in the output directory.
+Generates client/server code from a OpenAPI json/yaml definition. Finds files name `api.raml`, `client-api.raml` or `service-api.raml`.
+Processes these files (and the json schemes they refer to) to produce `open-api.yaml` files in the output directory.
-- `export-bom`
+## boat:export-bom
- Converts all RAML spec dependencies to OpenAPI Specs. See integration tests for examples
+Converts all RAML spec dependencies to OpenAPI Specs. See integration tests for examples
-- `export-dep`
+## boat:export-dep
- Exports project dependencies where the ArtifactId ends with. See integration tests for examples
- '-spec'.
+Exports project dependencies where the ArtifactId ends with. See integration tests for examples '-spec'.
+
+## boat:generate
+
+Open API Generator based on https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin. All configuration options as
+defined on openapi-generator-maven-plugin can be applied here too.
+
+Boat maven plugin uses slightly modified templates for html, java and webclient that help generate specs and clients that work best in a Backbase projects.
+
+## boat:generate-spring-boot-embedded
+
+Same with `generate` but with opinionated defaults for Spring
+
+
+ ${project.basedir}/../api/product-service-api/src/main/resources/openapi.yaml
+ com.backbase.product.api.service.v2
+ com.backbase.product.api.service.v2.model
+
+
+... is the same as:
+
+
+
+ true
+ spring-boat
+ true
+ false
+ false
+ ${project.basedir}/../api/product-service-api/src/main/resources/openapi.yaml
+
+ spring-boot
+ java8
+ true
+ true
+ true
+ false
+ true
+ true
+ false
+ com.backbase.product.api.service.v2
+ com.backbase.product.api.service.v2.model
+
+
+
+## boat:generate-rest-template-embedded
+
+Same with `generate` but with opinionated defaults for Rest Template Client
+
+
+
+ true
+ java
+ true
+ false
+ false
+ ${project.basedir}/../api/product-service-api/src/main/resources/openapi.yaml
+
+ resttemplate
+ java8
+ true
+ true
+ true
+ false
+ true
+ true
+ false
+ com.backbase.goldensample.product.api.client.v2
+ com.backbase.goldensample.product.api.client.v2.model
+
+
+
+## boat:generate-webclient-embedded
+
+Same with `generate` but with opinionated defaults for Web Client
+
+
+
+ true
+ java
+ true
+ false
+ false
+ ${project.basedir}/../api/product-service-api/src/main/resources/openapi.yaml
+
+ webclient
+ java8
+ true
+ true
+ true
+ false
+ true
+ true
+ false
+ com.backbase.goldensample.product.api.client.v2
+ com.backbase.goldensample.product.api.client.v2.model
+
+
+
+## boat:decompose
+
+Merges any components using allOf references.
+
+## boat:diff
+
+Calculates a Change log for APIs.
+
+## boat:remove-deprecated
+
+Removes deprecated elements in an OpenAPI spec.
+
+## boat:validate
+
+Validates OpenAPI specs.
+
+Configuration can point to a specific file, or a directory. When a directory is specified all files with a `.yaml`
+extension are validated. `failOnWarning` specifies whether to fail the build when validation violations are found,
+otherwise, warnings are written to the log for everyone to ignore.
-- `generate`
-
- Open API Generator based on https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin. All configuration options as
- defined on openapi-generator-maven-plugin can be applied here too.
- boat-maven-plugin uses slightly modified templates for html, java and webclient that help generate specs and clients that work best in a Backbase projects.
-
-- `generate-spring-boot-embedded`, `generate` but with opinionated defaults
-
-
- ${project.basedir}/../api/product-service-api/src/main/resources/openapi.yaml
- com.backbase.product.api.service.v2
- com.backbase.product.api.service.v2.model
-
-
- Is the same as:
-
-
-
- true
- spring-boat
- true
- false
- false
- ${project.basedir}/../api/product-service-api/src/main/resources/openapi.yaml
-
- spring-boot
- java8
- true
- true
- true
- false
- true
- true
- false
- com.backbase.product.api.service.v2
- com.backbase.product.api.service.v2.model
-
-
-- `generate-rest-template-embedded`, `generate` but with opinionated defaults
-
-
-
- true
- java
- true
- false
- false
- ${project.basedir}/../api/product-service-api/src/main/resources/openapi.yaml
-
- resttemplate
- java8
- true
- true
- true
- false
- true
- true
- false
- com.backbase.goldensample.product.api.client.v2
- com.backbase.goldensample.product.api.client.v2.model
-
-
-
-- `generate-webclient-embedded`, `generate` but with opinionated defaults
-
-
-
- true
- java
- true
- false
- false
- ${project.basedir}/../api/product-service-api/src/main/resources/openapi.yaml
-
- webclient
- java8
- true
- true
- true
- false
- true
- true
- false
- com.backbase.goldensample.product.api.client.v2
- com.backbase.goldensample.product.api.client.v2.model
-
-
-
-- `decompose`
-
- Merges any components using allOf references.
-
-- `diff`
-
- Calculates a Change log for APIs.
-
-- `remove-deprecated`
-
- Removes deprecated elements in an OpenAPI spec.
-
-- `boat:validate`
-
- Validates OpenAPI specs.
-
- Configuration can point to a specific file, or a directory. When a directory is specified all files with a `.yaml`
- extension are validated. `failOnWarning` specifies whether to fail the build when validation violations are found,
- otherwise, warnings are written to the log for everyone to ignore.
-
- ```
${project.build.outputDirectory}/specs/
true
- ```
-- `boat:lint`
+## boat:lint
- API lint which provides checks for compliance with many of Backbase's API standards
-
- Available parameters:
-
- failOnWarning (Default: false)
- Set this to true to fail in case a warning is found.
-
- ignoreRules
- List of rules ids which will be ignored.
-
- inputSpec
- Required: true
- Input spec directory or file.
-
- output (Default:
- ${project.build.directory}/boat-lint-reports)
- Output directory for lint reports.
-
- showIgnoredRules (Default: false)
- Set this to true to show the list of ignored rules..
+API lint which provides checks for compliance with many of Backbase's API standards
+
+Available parameters:
+
+ failOnWarning (Default: false)
+ Set this to true to fail in case a warning is found.
+
+ ignoreRules
+ List of rules ids which will be ignored.
+
+ inputSpec
+ Required: true
+ Input spec directory or file.
+
+ output (Default: ${project.build.directory}/boat-lint-reports)
+ Output directory for lint reports.
+
+ showIgnoredRules (Default: false)
+ Set this to true to show the list of ignored rules..
- writeLintReport (Default: true)
- Set this to true to generate lint report.
-
- Example:
-
- ```
-
- ${unversioned-filename-spec-dir}/
-
- true
- ${ignored-lint-rules}
- true
+ writeLintReport (Default: true)
+ Set this to true to generate lint report.
+
+Example:
+
+
+ ${unversioned-filename-spec-dir}/
+
+ true
+ ${ignored-lint-rules}
+ true
- ```
-
- To see details about this goal:
-
-`mvn help:describe -DgroupId=com.backbase.oss -DartifactId=boat-maven-plugin -Dgoal=lint -Ddetail`
+
+To see details about this goal:
+
+ mvn help:describe -DgroupId=com.backbase.oss -DartifactId=boat-maven-plugin -Dgoal=lint -Ddetail`
-- `boat:bundle`
-
- Bundles a spec by resolving external references.
-
- Configuration can point to a single in- and output file, or to in- and output directories. When directories are
- specified, all files specified by the `includes` parameter are bundled.
-
- Examples in `json` files are parsed to objects.
- ```
+## boat:bundle
+
+Bundles a spec by resolving external references.
+
+Configuration can point to a single in- and output file, or to in- and output directories. When directories are
+specified, all files specified by the `includes` parameter are bundled.
+
+Examples in `json` files are parsed to objects.
+
${bundle.skip}
${project.basedir}/src/main/resources/
@@ -196,14 +197,11 @@ The `boat` plugin has multiple goals:
- ```
-
-
For more information, run
-`mvn help:describe -Dplugin=com.backbase.oss:boat-maven-plugin -Ddetail`
+ mvn help:describe -Dplugin=com.backbase.oss:boat-maven-plugin -Dgoal=bundle -Ddetail
-## Configuration examples
+Configuration example
```$xml
@@ -243,6 +241,83 @@ For more information, run
```
Usage
-```mvn boat:generate```
+
+ mvn boat:generate
Or hook up to your build process by adding ```executions``` configuration.
+
+## boat:transform
+
+Apply transformers to an existing specification.
+
+Available parameters:
+
+ inputs
+ Required: true
+ User property: boat.transform.inputs
+ A list of input specifications.
+
+ mappers
+ File name mappers used to generate the output file name, instances of
+ org.codehaus.plexus.components.io.filemappers.FileMapper.
+ The following mappers can be used without needing to specify the FQCN of
+ the implementation.
+
+ regexp:
+ org.codehaus.plexus.components.io.filemappers.RegExpFileMapper
+ merge:
+ org.codehaus.plexus.components.io.filemappers.MergeFileMapper
+ prefix:
+ org.codehaus.plexus.components.io.filemappers.PrefixFileMapper
+ suffix:
+ org.codehaus.plexus.components.io.filemappers.SuffixFileMapper
+
+ The parameter defaults to
+
+
+ -transformed
+
+
+ options
+ Additional options passed to transformers.
+
+ output (Default: ${project.build.directory})
+ User property: boat.transform.output
+ Target directory of the transformed specifications.
+
+ pipeline
+ Required: true
+ The list of transformers to be applied to each input specification.
+
+ serverId
+ User property: boat.transform.serverId
+ Retrieves authorization from Maven's settings.xml.
+
+ skip
+ Alias: codegen.skip
+ User property: boat.transform.skip
+ Whether to skip the execution of this goal.
+
+Configuration example
+
+```$xml
+
+
+ ${project.build.directory}/openapi.yaml
+
+
+ ${spec.name}-${spec.version}.yaml
+
+
+ ${spec.version}
+
+
+ abstract
+ implements
+ extra-annotation
+ extra-java-code
+
+
+
+
+```
diff --git a/boat-maven-plugin/pom.xml b/boat-maven-plugin/pom.xml
index b259d1dec..baa0b2ae5 100644
--- a/boat-maven-plugin/pom.xml
+++ b/boat-maven-plugin/pom.xml
@@ -1,11 +1,12 @@
-
+4.0.0com.backbase.ossbackbase-openapi-tools
- 0.14.2-SNAPSHOT
+ 0.14.3-SNAPSHOTboat-maven-plugin
@@ -81,6 +82,11 @@
plexus-build-api0.0.7
+
+ org.codehaus.plexus
+ plexus-io
+ 3.2.0
+ org.apache.maven
@@ -111,15 +117,18 @@
org.junit.jupiterjunit-jupiter-params
- 5.7.0test
-
org.junit.jupiterjunit-jupitertest
+
+ org.mockito
+ mockito-junit-jupiter
+ test
+ org.apache.maven.sharedmaven-invoker
diff --git a/boat-maven-plugin/src/it/example/boat-artifact-input/artifact-input/pom.xml b/boat-maven-plugin/src/it/example/boat-artifact-input/artifact-input/pom.xml
new file mode 100644
index 000000000..9e4491ffe
--- /dev/null
+++ b/boat-maven-plugin/src/it/example/boat-artifact-input/artifact-input/pom.xml
@@ -0,0 +1,49 @@
+
+
+ 4.0.0
+
+
+ com.backbase.oss.boat.example
+ boat-artifact-input
+ 1.0.0-SNAPSHOT
+
+
+ artifact-input
+ pom
+
+ BOAT :: Input artifact
+
+
+
+
+ com.backbase.oss
+ boat-maven-plugin
+
+
+ generate-docs-from-zip
+ generate-sources
+
+ doc
+
+
+
+ com.backbase.oss.boat.example
+ openapi-zips
+ 1.0.0-SNAPSHOT
+ api
+ zip
+ presentation-client-api/openapi.yaml
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-spec-bom/pom.xml b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-spec-bom/pom.xml
new file mode 100644
index 000000000..e213c287b
--- /dev/null
+++ b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-spec-bom/pom.xml
@@ -0,0 +1,32 @@
+
+
+ 4.0.0
+
+ com.backbase.oss.boat.example
+ openapi-spec-bom
+ 1.0.0-SNAPSHOT
+
+
+ 1.0.0-SNAPSHOT
+
+
+ pom
+
+ BOAT :: OpenAPI Bill-Of-Materials
+
+
+
+
+ com.backbase.oss.boat.example
+ openapi-zips
+ ${openapi-spec.version}
+
+
+
+
+
+
+
+
diff --git a/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-zips/pom.xml b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-zips/pom.xml
new file mode 100644
index 000000000..8a0113446
--- /dev/null
+++ b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-zips/pom.xml
@@ -0,0 +1,40 @@
+
+
+ 4.0.0
+
+ com.backbase.oss.boat.example
+
+
+ openapi-zips
+ 1.0.0-SNAPSHOT
+
+
+ BOAT :: OpenAPI Example
+
+
+
+
+ maven-assembly-plugin
+ 3.1.0
+
+
+ create-archive
+ package
+
+ single
+
+
+
+ src/assembly/build.xml
+
+
+
+
+
+
+
+
+
+
diff --git a/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-zips/src/assembly/build.xml b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-zips/src/assembly/build.xml
new file mode 100644
index 000000000..8a0b62203
--- /dev/null
+++ b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-zips/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-artifact-input/openapi-specs/openapi-zips/src/main/resources/presentation-client-api/index.html b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-zips/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-artifact-input/openapi-specs/openapi-zips/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-artifact-input/openapi-specs/openapi-zips/src/main/resources/presentation-client-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-zips/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-artifact-input/openapi-specs/openapi-zips/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-artifact-input/openapi-specs/openapi-zips/src/main/resources/presentation-integration-api/index.html b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-zips/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-artifact-input/openapi-specs/openapi-zips/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-artifact-input/openapi-specs/openapi-zips/src/main/resources/presentation-integration-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-zips/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-artifact-input/openapi-specs/openapi-zips/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-artifact-input/openapi-specs/openapi-zips/src/main/resources/presentation-service-api/index.html b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-zips/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-artifact-input/openapi-specs/openapi-zips/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-artifact-input/openapi-specs/openapi-zips/src/main/resources/presentation-service-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/openapi-zips/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-artifact-input/openapi-specs/openapi-zips/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/boat-artifact-input/openapi-specs/pom.xml b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/pom.xml
new file mode 100644
index 000000000..b9cd10ba3
--- /dev/null
+++ b/boat-maven-plugin/src/it/example/boat-artifact-input/openapi-specs/pom.xml
@@ -0,0 +1,23 @@
+
+
+ 4.0.0
+
+
+ com.backbase.oss.boat.example
+ boat-artifact-input
+ 1.0.0-SNAPSHOT
+
+
+ openapi-specs
+ pom
+
+
+
+ openapi-zips
+ openapi-spec-bom
+
+
+
+
diff --git a/boat-maven-plugin/src/it/example/boat-artifact-input/pom.xml b/boat-maven-plugin/src/it/example/boat-artifact-input/pom.xml
new file mode 100644
index 000000000..073f0b85d
--- /dev/null
+++ b/boat-maven-plugin/src/it/example/boat-artifact-input/pom.xml
@@ -0,0 +1,31 @@
+
+
+ 4.0.0
+
+
+ com.backbase.oss.boat.example
+ example
+ 1.0.0-SNAPSHOT
+
+
+ boat-artifact-input
+ pom
+
+ BOAT :: DOCandLint
+
+
+ Example projects showing exporting RAML to OpenAPI from source files.
+ Specs can be in source files, or retrieved from dependencies
+
+
+
+
+ openapi-specs
+ artifact-input
+
+
+
+
+
diff --git a/boat-maven-plugin/src/it/example/boat-multiple-executions/pom.xml b/boat-maven-plugin/src/it/example/boat-multiple-executions/pom.xml
new file mode 100644
index 000000000..97e6c0638
--- /dev/null
+++ b/boat-maven-plugin/src/it/example/boat-multiple-executions/pom.xml
@@ -0,0 +1,60 @@
+
+
+ 4.0.0
+
+
+ com.backbase.oss.boat.example
+ example
+ 1.0.0-SNAPSHOT
+
+
+ boat-multiple-executions
+ pom
+
+ BOAT :: Execute multiple
+
+
+
+
+ com.backbase.oss
+ boat-maven-plugin
+
+
+ generate-rest-template-embedded
+ generate-sources
+
+ doc
+
+
+ https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/api-with-examples.yaml
+
+
+
+ lint
+ verify
+
+ lint
+
+
+ ${project.basedir}/src/main/resources/presentation-client-api/openapi.yaml
+
+
+
+ generate-docs
+ generate-sources
+
+ doc
+
+
+ ${project.basedir}/src/main/resources/presentation-integration-api/openapi.yaml
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/boat-maven-plugin/src/it/example/boat-multiple-executions/src/main/resources/presentation-client-api/index.html b/boat-maven-plugin/src/it/example/boat-multiple-executions/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-multiple-executions/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-multiple-executions/src/main/resources/presentation-client-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-multiple-executions/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-multiple-executions/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-multiple-executions/src/main/resources/presentation-integration-api/index.html b/boat-maven-plugin/src/it/example/boat-multiple-executions/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-multiple-executions/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-multiple-executions/src/main/resources/presentation-integration-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-multiple-executions/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-multiple-executions/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-multiple-executions/src/main/resources/presentation-service-api/index.html b/boat-maven-plugin/src/it/example/boat-multiple-executions/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-multiple-executions/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-multiple-executions/src/main/resources/presentation-service-api/openapi.yaml b/boat-maven-plugin/src/it/example/boat-multiple-executions/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-multiple-executions/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/pom.xml b/boat-maven-plugin/src/it/example/pom.xml
index 4c8001a69..58f0aa68f 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-multiple-executions
+ boat-artifact-inputboat-docboat-exportboat-generate
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/AbstractGenerateMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/AbstractGenerateMojo.java
index bab59ae21..1d7385642 100644
--- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/AbstractGenerateMojo.java
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/AbstractGenerateMojo.java
@@ -3,11 +3,12 @@
import java.util.HashMap;
import java.util.Map;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
public abstract class AbstractGenerateMojo extends GenerateMojo {
public void execute(String generatorName, String library, boolean isEmbedded, boolean reactive, boolean generateSupportingFiles)
- throws MojoExecutionException {
+ throws MojoExecutionException, MojoFailureException {
Map options = new HashMap<>();
options.put("library", library);
options.put("java8", "true");
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/AbstractLintMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/AbstractLintMojo.java
index 867000785..81cb645e2 100644
--- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/AbstractLintMojo.java
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/AbstractLintMojo.java
@@ -9,8 +9,8 @@
import java.util.Arrays;
import java.util.List;
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.Parameter;
@SuppressWarnings("FieldMayBeFinal")
@@ -18,13 +18,8 @@
/*
Lint Specification
*/
-public abstract class AbstractLintMojo extends AbstractMojo {
+public abstract class AbstractLintMojo extends InputMavenArtifactMojo {
- /**
- * Input spec directory or file.
- */
- @Parameter(name = "inputSpec", property = "inputSpec", required = true)
- protected File inputSpec;
/**
* Set this to true to fail in case a warning is found.
@@ -47,18 +42,21 @@ public abstract class AbstractLintMojo extends AbstractMojo {
"151","129","146","147","172","145","115","132","120", "134","183","154","105","104","130","118","110","153",
"101","176","116","M009","H002","M010","H001","M008","S005","S006","S007","M011"};
- protected List lint() throws MojoExecutionException {
+ protected List lint() throws MojoExecutionException, MojoFailureException {
+
+ super.execute();
+
List boatLintReports = new ArrayList<>();
File[] inputFiles;
- if (inputSpec.isDirectory()) {
- inputFiles = inputSpec.listFiles(pathname -> pathname.getName().endsWith(".yaml"));
+ if (input.isDirectory()) {
+ inputFiles = input.listFiles(pathname -> pathname.getName().endsWith(".yaml"));
if (inputFiles == null || inputFiles.length == 0) {
throw new MojoExecutionException("No OpenAPI specs found in: " + inputSpec);
}
log.info("Found " + inputFiles.length + " specs to lint.");
} else {
- inputFiles = new File[]{inputSpec};
+ inputFiles = new File[]{input};
}
for (File inputFile : inputFiles) {
@@ -82,8 +80,9 @@ private BoatLintReport lintOpenAPI(File inputFile) throws MojoExecutionException
}
}
+ @Override
public void setInput(File input) {
- this.inputSpec = input;
+ this.input = input;
}
public void setFailOnWarning(boolean failOnWarning) {
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/AbstractRamlToOpenApi.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/AbstractRamlToOpenApi.java
index 522451aa9..caa0fab21 100644
--- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/AbstractRamlToOpenApi.java
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/AbstractRamlToOpenApi.java
@@ -40,9 +40,6 @@
import org.eclipse.aether.impl.ArtifactResolver;
import org.eclipse.aether.impl.MetadataResolver;
import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.resolution.ArtifactRequest;
-import org.eclipse.aether.resolution.ArtifactResolutionException;
-import org.eclipse.aether.resolution.ArtifactResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -467,23 +464,6 @@ public void setServers(List servers) {
this.servers = servers;
}
- public ArtifactResult resolveArtifactFromRepositories(org.eclipse.aether.artifact.Artifact artifact) {
- ArtifactRequest artifactRequest = getArtifactRequest(artifact);
-
- ArtifactResult artifactResult = null;
- try {
- artifactResult = artifactResolver.resolveArtifact(repositorySession, artifactRequest);
- } catch (ArtifactResolutionException e) {
- throw new IllegalArgumentException("Cannot resolve artifact: " + artifact);
- }
- return artifactResult;
-
- }
-
- private ArtifactRequest getArtifactRequest(org.eclipse.aether.artifact.Artifact artifact) {
- return new ArtifactRequest(artifact, remoteRepositories, null);
- }
-
protected DefaultArtifact createNewDefaultArtifact(Dependency dependency) {
return new DefaultArtifact(dependency.getGroupId()
, dependency.getArtifactId()
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/ArtifactRepositoryResolver.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/ArtifactRepositoryResolver.java
new file mode 100644
index 000000000..090b7010d
--- /dev/null
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/ArtifactRepositoryResolver.java
@@ -0,0 +1,44 @@
+package com.backbase.oss.boat;
+
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.impl.ArtifactResolver;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactRequest;
+import org.eclipse.aether.resolution.ArtifactResolutionException;
+import org.eclipse.aether.resolution.ArtifactResult;
+
+import java.util.List;
+
+public class ArtifactRepositoryResolver {
+
+ private final ArtifactResolver artifactResolver;
+ private final RepositorySystemSession repositorySession;
+ private final List remoteRepositories;
+
+ public ArtifactRepositoryResolver(ArtifactResolver artifactResolver, RepositorySystemSession repositorySession, List remoteRepositories) {
+ this.artifactResolver = artifactResolver;
+ this.repositorySession = repositorySession;
+ this.remoteRepositories = remoteRepositories;
+ }
+
+
+ public ArtifactResult resolveArtifactFromRepositories(org.eclipse.aether.artifact.Artifact artifact) {
+ ArtifactRequest artifactRequest = getArtifactRequest(artifact);
+
+ ArtifactResult artifactResult = null;
+ try {
+ artifactResult = artifactResolver.resolveArtifact(repositorySession, artifactRequest);
+ } catch (ArtifactResolutionException e) {
+ throw new IllegalArgumentException("Cannot resolve artifact: " + artifact);
+ }
+ return artifactResult;
+
+ }
+
+
+ private ArtifactRequest getArtifactRequest(org.eclipse.aether.artifact.Artifact artifact) {
+
+ return new ArtifactRequest(artifact, remoteRepositories, null);
+ }
+
+}
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 be7f74223..fd105a2ea 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
@@ -9,8 +9,8 @@
import com.backbase.oss.boat.loader.OpenAPILoaderException;
import com.backbase.oss.boat.serializer.SerializerUtils;
import com.backbase.oss.boat.transformers.Bundler;
-import com.backbase.oss.boat.transformers.SpecVersionTransformer;
-import com.backbase.oss.boat.transformers.VendorExtensionFilter;
+import com.backbase.oss.boat.transformers.SetVersion;
+import com.backbase.oss.boat.transformers.ExtensionFilter;
import io.swagger.v3.oas.models.OpenAPI;
import java.io.File;
import java.io.IOException;
@@ -110,7 +110,7 @@ private void bundleOpenAPI(File inputFile, File outputFile) throws MojoExecution
OpenAPI openAPI = OpenAPILoader.load(inputFile);
if (isNotBlank(version)) {
- openAPI = new SpecVersionTransformer(version)
+ openAPI = new SetVersion(version)
.transform(openAPI);
}
@@ -118,7 +118,7 @@ private void bundleOpenAPI(File inputFile, File outputFile) throws MojoExecution
.transform(openAPI);
if (isNotEmpty(removeExtensions)) {
- openAPI = new VendorExtensionFilter()
+ openAPI = new ExtensionFilter()
.transform(openAPI, singletonMap("remove", removeExtensions));
}
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/ExportBomMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/ExportBomMojo.java
index e64536660..94a6a149c 100644
--- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/ExportBomMojo.java
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/ExportBomMojo.java
@@ -64,6 +64,8 @@ public class ExportBomMojo extends AbstractRamlToOpenApi {
@Parameter(name = "addChangeLog", defaultValue = "true")
private boolean addChangeLog;
+ public void setSpecBom(Dependency specBom){this.specBom = specBom;}
+
@Override
public void execute() throws MojoExecutionException {
@@ -113,7 +115,7 @@ public void execute() throws MojoExecutionException {
.filter(versionRange::containsVersion)
.distinct()
.map(this::convertToArtifact)
- .map(this::resolveArtifactFromRepositories)
+ .map(defaultArtifact -> new ArtifactRepositoryResolver(artifactResolver,repositorySession,remoteRepositories).resolveArtifactFromRepositories(defaultArtifact))
.map(this::parsePomFile)
.map(this::groupArtifactsPerVersionAndCapability)
.collect(Collectors.toList());
@@ -147,7 +149,7 @@ private Pair>> groupArtifactsPerVers
.filter(this::isIncludedSpec)
.map(this::createNewDefaultArtifact)
.distinct()
- .map(this::resolveArtifactFromRepositories)
+ .map(defaultArtifact -> new ArtifactRepositoryResolver(artifactResolver,repositorySession,remoteRepositories).resolveArtifactFromRepositories(defaultArtifact))
.collect(Collectors
.groupingBy(artifactResult -> artifactResult.getArtifact().getGroupId(), TreeMap::new,
Collectors.toSet()));
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateDocMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateDocMojo.java
index 5424e916b..1b16ae73b 100644
--- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateDocMojo.java
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateDocMojo.java
@@ -2,14 +2,15 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
@Mojo(name = "doc", threadSafe = true)
@Slf4j
-public class GenerateDocMojo extends GenerateMojo {
+public class GenerateDocMojo extends GenerateFromDirectoryDocMojo {
@Override
- public void execute() throws MojoExecutionException {
+ public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info("Generating Boat Docs");
generatorName = "boat-docs";
super.execute();
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateFromDirectoryDocMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateFromDirectoryDocMojo.java
new file mode 100644
index 000000000..dbb31e553
--- /dev/null
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateFromDirectoryDocMojo.java
@@ -0,0 +1,61 @@
+package com.backbase.oss.boat;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+import java.io.File;
+
+/**
+ * Allows generate::Doc to accept inputSpec as a directory
+ * Output docs will be placed in separate folders for each spec
+ */
+@Slf4j
+public class GenerateFromDirectoryDocMojo extends GenerateMojo {
+
+
+ @Override
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ if (inputSpec != null) {
+ File inputSpecFile = new File(inputSpec);
+ fileInputExecute(inputSpecFile);
+ } else {
+ log.info("Input read as Artifact");
+ super.execute();
+ }
+ }
+
+ private void fileInputExecute(File inputSpecFile) throws MojoExecutionException, MojoFailureException {
+
+ if (inputSpecFile.isDirectory()) {
+ log.info("inputSpec is being read as a directory");
+
+ File[] inputSpecs;
+ File outPutDirectory = output;
+
+ inputSpecs = inputSpecFile.listFiles(pathname -> pathname.getName().endsWith(".yaml"));
+
+ if (inputSpecs == null || inputSpecs.length == 0) {
+ throw new MojoExecutionException("No OpenAPI specs found in: " + inputSpec);
+ }
+
+ for (File f : inputSpecs) {
+ inputSpec = f.getPath();
+ output = new File(outPutDirectory.getPath(), f.getName().substring(0, f.getName().lastIndexOf(".")).concat("-docs"));
+
+ if (!output.exists()) {
+ output.mkdir();
+ }
+
+ log.info(" Generating docs for spec {} in directory", f.getName());
+ super.execute();
+ }
+
+ } else {
+
+ log.info("inputSpec being read as a single file");
+ super.execute();
+
+ }
+ }
+}
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateMojo.java
index bb7191f1d..d3193be90 100644
--- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateMojo.java
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateMojo.java
@@ -31,15 +31,15 @@
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
+import java.util.stream.Stream;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-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.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.project.MavenProject;
import org.openapitools.codegen.CliOption;
import org.openapitools.codegen.ClientOptInput;
import org.openapitools.codegen.CodegenConfig;
@@ -77,7 +77,7 @@
@SuppressWarnings({"DefaultAnnotationParam", "java:S3776", "java:S5411"})
@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true)
@Slf4j
-public class GenerateMojo extends AbstractMojo {
+public class GenerateMojo extends InputMavenArtifactMojo {
private static String trimCSV(String text) {
if (isNotEmpty(text)) {
@@ -136,21 +136,6 @@ private static String trimCSV(String text) {
protected File copyTo;
- /**
- * Location of the OpenAPI spec, as URL or local file glob pattern.
- *
- * If the input is a local file, the value of this property is considered a glob pattern that must
- * resolve to a unique file.
- *
- *
- * The glob pattern allows to express the input specification in a version neutral way. For
- * instance, if the actual file is {@code my-service-api-v3.1.4.yaml} the expression could be
- * {@code my-service-api-v*.yaml}.
- *
- */
- @Parameter(name = "inputSpec", property = "openapi.generator.maven.plugin.inputSpec", required = true)
- protected String inputSpec;
-
/**
* Git host, e.g. gitlab.com.
*/
@@ -486,11 +471,7 @@ private static String trimCSV(String text) {
@Parameter(name = "writeDebugFiles")
protected boolean writeDebugFiles = false;
- /**
- * The project being built.
- */
- @Parameter(readonly = true, required = true, defaultValue = "${project}")
- protected MavenProject project;
+
public void setBuildContext(BuildContext buildContext) {
this.buildContext = buildContext;
@@ -498,13 +479,15 @@ public void setBuildContext(BuildContext buildContext) {
@Override
@SuppressWarnings({"java:S3776", "java:S1874"})
- public void execute() throws MojoExecutionException {
+ public void execute() throws MojoExecutionException, MojoFailureException {
+
if (skip) {
getLog().info("Code generation is skipped.");
return;
}
+ super.execute();
File inputSpecFile = new File(inputSpec);
File inputParent = inputSpecFile.getParentFile();
@@ -524,6 +507,11 @@ public void execute() throws MojoExecutionException {
break;
default:
+ String message = format("Input spec %s matches more than one single file", inputSpec);
+ getLog().error(message);
+ Stream.of(files).forEach(f -> {
+ getLog().error(format(" %s", f));
+ });
throw new MojoExecutionException(
format("Input spec %s matches more than one single file", inputSpec));
}
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateRestTemplateEmbeddedMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateRestTemplateEmbeddedMojo.java
index f21a705a4..53eb60342 100644
--- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateRestTemplateEmbeddedMojo.java
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateRestTemplateEmbeddedMojo.java
@@ -1,6 +1,7 @@
package com.backbase.oss.boat;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
/**
@@ -10,7 +11,7 @@
public class GenerateRestTemplateEmbeddedMojo extends AbstractGenerateMojo {
@Override
- public void execute() throws MojoExecutionException {
+ public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info("Generating Client using Spring Rest Template");
execute("java", "resttemplate", true, false, true);
}
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateSpringBootEmbeddedMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateSpringBootEmbeddedMojo.java
index 15f17d5d2..f4bd2a569 100644
--- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateSpringBootEmbeddedMojo.java
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateSpringBootEmbeddedMojo.java
@@ -1,6 +1,7 @@
package com.backbase.oss.boat;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
/**
@@ -10,7 +11,7 @@
public class GenerateSpringBootEmbeddedMojo extends AbstractGenerateMojo {
@Override
- public void execute() throws MojoExecutionException {
+ public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info("Generating Server Stubs using Spring Boot");
execute("spring", "spring-boot", true, false, false);
}
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateWebClientEmbeddedMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateWebClientEmbeddedMojo.java
index 76bdc7c50..bf8ad91fc 100644
--- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateWebClientEmbeddedMojo.java
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateWebClientEmbeddedMojo.java
@@ -1,6 +1,7 @@
package com.backbase.oss.boat;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
/**
@@ -10,7 +11,7 @@
public class GenerateWebClientEmbeddedMojo extends AbstractGenerateMojo {
@Override
- public void execute() throws MojoExecutionException {
+ public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info("Generating Server Stubs using Web Client Boot");
execute("java", "webclient", true, true, true);
}
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/InputArtifact.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/InputArtifact.java
new file mode 100644
index 000000000..da7e17a27
--- /dev/null
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/InputArtifact.java
@@ -0,0 +1,42 @@
+package com.backbase.oss.boat;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+
+
+@Getter
+@Setter
+@Slf4j
+public class InputArtifact {
+ private String groupId;
+ private String artifactId;
+ private String version;
+ private String type;
+ private String classifier;
+ private String fileName;
+ private boolean overWrite;
+ private boolean overWriteIfNewer;
+ private boolean needsProcessing;
+
+ public boolean isNeedsProcessing(File destFile, File originFile){
+ needsProcessing = overWrite || !destFile.exists() || (overWriteIfNewer && isNewer(destFile,originFile));
+ return needsProcessing;
+ }
+
+ private boolean isNewer( File destFile, File originFile ) {
+ try {
+ long destMod = Files.getLastModifiedTime( destFile.toPath() ).toMillis();
+ long originMod = Files.getLastModifiedTime( originFile.toPath() ).toMillis();
+ return originMod > destMod;
+ } catch (IOException e) {
+ log.debug("Assuming artifact was not modified since artifact was last downloaded, cannot last read modified time");
+ return false;
+ }
+
+ }
+}
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/InputMavenArtifactMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/InputMavenArtifactMojo.java
new file mode 100644
index 000000000..579c1d310
--- /dev/null
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/InputMavenArtifactMojo.java
@@ -0,0 +1,181 @@
+package com.backbase.oss.boat;
+
+
+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.Parameter;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.Expand;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.impl.ArtifactResolver;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactResult;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+@Slf4j
+public class InputMavenArtifactMojo extends AbstractMojo {
+
+ /**
+ * A maven artifact containing a spec, or multiple to be processed
+ */
+ @Parameter(name = "inputMavenArtifact", property = "inputMavenArtifact", required = false)
+ protected InputArtifact inputMavenArtifact;
+
+ /**
+ * File input used for Linting and Validating
+ * Can be directory or file
+ */
+ @Parameter(name = "input", required = false)
+ protected File input;
+
+ /**
+ * Location of the OpenAPI spec, as URL or local file glob pattern.
+ *
+ * If the input is a local file, the value of this property is considered a glob pattern that must
+ * resolve to a unique file.
+ *
+ *
+ * The glob pattern allows to express the input specification in a version neutral way. For
+ * instance, if the actual file is {@code my-service-api-v3.1.4.yaml} the expression could be
+ * {@code my-service-api-v*.yaml}.
+ *
+ */
+ @Parameter(name = "inputSpec", property = "openapi.generator.maven.plugin.inputSpec", required = false)
+ protected String inputSpec;
+
+ /**
+ * The project being built.
+ */
+ @Parameter(readonly = true, required = true, defaultValue = "${project}")
+ protected MavenProject project;
+
+ /**
+ * Used to set up artifact request
+ */
+ @Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
+ protected RepositorySystemSession repositorySession;
+
+ /**
+ * Used to look up Artifacts in the remote repository.
+ */
+ @Component
+ protected ArtifactResolver artifactResolver;
+
+ /**
+ * List of Remote Repositories used by the resolver.
+ */
+ @Parameter(defaultValue = "${project.remoteProjectRepositories}", readonly = true)
+ protected List remoteRepositories;
+
+ private final ReentrantLock reLock = new ReentrantLock(true);
+
+ @Override
+ public void execute() throws MojoExecutionException, MojoFailureException {
+
+ if (inputMavenArtifact != null && inputMavenArtifact.getArtifactId() != null) {
+ getArtifact();
+ }
+
+ if (input == null && inputSpec == null && inputMavenArtifact == null) {
+ throw new MojoExecutionException("Missing input from plugin, input options are: inputMavenArtifact, input, inputSpec");
+ }
+
+ if (input == null) {
+ input = new File(inputSpec);
+ }
+
+ }
+
+
+ private void getArtifact() throws MojoExecutionException {
+ ArtifactResult result;
+
+ File specUnzipDirectory = new File(project.getBuild().getDirectory()
+ + File.separator + "input-artifact" + File.separator
+ + inputMavenArtifact.getArtifactId(), inputMavenArtifact.getVersion());
+
+
+
+
+
+ // The artifact will be downloaded to the local repository if necessary. An artifact that is already resolved will
+ // be skipped and is not re-resolved.
+ result = new ArtifactRepositoryResolver(artifactResolver, repositorySession, remoteRepositories).resolveArtifactFromRepositories(new DefaultArtifact(inputMavenArtifact.getGroupId()
+ , inputMavenArtifact.getArtifactId()
+ , inputMavenArtifact.getClassifier()
+ , inputMavenArtifact.getType()
+ , inputMavenArtifact.getVersion()));
+
+ if (inputMavenArtifact.isNeedsProcessing(specUnzipDirectory,result.getArtifact().getFile())) {
+
+ unzipSpec(result.getArtifact().getFile(), specUnzipDirectory);
+
+ }
+
+ try (Stream walk = Files.walk(specUnzipDirectory.toPath())) {
+
+ List paths = walk
+ .filter(Files::isRegularFile)
+ .filter(path -> path.endsWith(inputMavenArtifact.getFileName()))
+ .map(Path::toString)
+ .collect(Collectors.toList());
+
+ if (paths.size() > 1) {
+ log.info("found multiple files of matching {} in zip, using {}", inputMavenArtifact.getFileName(), paths.get(0));
+ } else if (paths.isEmpty()) {
+ throw new MojoExecutionException("no file matching " + inputMavenArtifact.getFileName() + " was found in artifact zip");
+ }
+
+ inputSpec = paths.get(0);
+ input = new File(paths.get(0));
+
+ } catch (IOException e) {
+ log.debug(e.getMessage());
+ throw new MojoExecutionException("Could not search unzipped artifact directory");
+ }
+
+ }
+
+
+ private void unzipSpec(File inputFile, File specUnzipDirectory) throws MojoExecutionException {
+ reLock.lock();
+ try {
+ specUnzipDirectory.mkdirs();
+ unzip(inputFile, specUnzipDirectory);
+ } catch (Exception e) {
+ reLock.unlock();
+ throw new MojoExecutionException("Error extracting spec: " + inputFile, e);
+ }finally {
+ reLock.unlock();
+ }
+ }
+
+ private void unzip(File source, File out) throws Exception {
+ Expand expand = new Expand();
+ expand.setSrc(source);
+ expand.setDest(out);
+ expand.setOverwrite(true);
+ expand.execute();
+ }
+
+ public void setInput(File input) {
+ this.input = input;
+ }
+
+}
+
+
+
+
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/Merge.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/Merge.java
new file mode 100644
index 000000000..509904e9e
--- /dev/null
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/Merge.java
@@ -0,0 +1,22 @@
+package com.backbase.oss.boat.transformers;
+
+import lombok.NoArgsConstructor;
+import org.codehaus.plexus.components.io.filemappers.MergeFileMapper;
+
+/**
+ * Merge mapper, easy to configure in {@code pom.xml}
+ */
+@NoArgsConstructor
+public class Merge extends MergeFileMapper {
+
+ public Merge(String value) {
+ set(value);
+ }
+
+ /**
+ * Default setter, used at creation from POM configuration.
+ */
+ public void set(String value) {
+ setTargetName(value);
+ }
+}
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/Prefix.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/Prefix.java
new file mode 100644
index 000000000..ea16544da
--- /dev/null
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/Prefix.java
@@ -0,0 +1,22 @@
+package com.backbase.oss.boat.transformers;
+
+import lombok.NoArgsConstructor;
+import org.codehaus.plexus.components.io.filemappers.PrefixFileMapper;
+
+/**
+ * Prefix mapper, easy to configure in {@code pom.xml}
+ */
+@NoArgsConstructor
+public class Prefix extends PrefixFileMapper {
+
+ public Prefix(String value) {
+ set(value);
+ }
+
+ /**
+ * Default setter, used at creation from POM configuration.
+ */
+ public void set(String value) {
+ setPrefix(value);
+ }
+}
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/Regex.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/Regex.java
new file mode 100644
index 000000000..fbd67ad72
--- /dev/null
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/Regex.java
@@ -0,0 +1,16 @@
+package com.backbase.oss.boat.transformers;
+
+import lombok.NoArgsConstructor;
+import org.codehaus.plexus.components.io.filemappers.RegExpFileMapper;
+
+/**
+ * Regex mapper, easy to configure in {@code pom.xml}
+ */
+@NoArgsConstructor
+public class Regex extends RegExpFileMapper {
+
+ public Regex(String pattern, String replacement) {
+ setPattern(pattern);
+ setReplacement(replacement);
+ }
+}
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/Suffix.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/Suffix.java
new file mode 100644
index 000000000..60ab2a34b
--- /dev/null
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/Suffix.java
@@ -0,0 +1,20 @@
+package com.backbase.oss.boat.transformers;
+
+import org.codehaus.plexus.components.io.filemappers.SuffixFileMapper;
+
+/**
+ * Suffix mapper, easy to configure in {@code pom.xml}
+ */
+public class Suffix extends SuffixFileMapper {
+
+ public Suffix(String value) {
+ set(value);
+ }
+
+ /**
+ * Default setter, used at creation from POM configuration.
+ */
+ public void set(String value) {
+ setSuffix(value);
+ }
+}
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/TransformMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/TransformMojo.java
new file mode 100644
index 000000000..c68e55f75
--- /dev/null
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/transformers/TransformMojo.java
@@ -0,0 +1,226 @@
+package com.backbase.oss.boat.transformers;
+
+import com.backbase.oss.boat.loader.OpenAPILoader;
+import com.backbase.oss.boat.serializer.SerializerUtils;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.parser.core.models.AuthorizationValue;
+import java.io.File;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.StandardOpenOption;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import lombok.SneakyThrows;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.maven.execution.MavenSession;
+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.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.settings.Server;
+import org.apache.maven.settings.building.SettingsProblem;
+import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
+import org.apache.maven.settings.crypto.SettingsDecryptionRequest;
+import org.apache.maven.settings.crypto.SettingsDecryptionResult;
+import org.codehaus.plexus.components.io.filemappers.FileMapper;
+
+import static java.lang.String.format;
+import static java.util.Optional.ofNullable;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+
+/**
+ * Apply transformers to an existing specification.
+ */
+@Mojo(name = "transform", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true)
+public class TransformMojo extends AbstractMojo {
+
+ /**
+ * Whether to skip the execution of this goal.
+ */
+ @Parameter(property = "boat.transform.skip", alias = "codegen.skip")
+ boolean skip;
+
+ /**
+ * A list of input specifications.
+ */
+ @Parameter(property = "boat.transform.inputs", required = true)
+ final List inputs = new ArrayList<>();
+
+ /**
+ * Target directory of the transformed specifications.
+ */
+ @Parameter(property = "boat.transform.output", defaultValue = "${project.build.directory}")
+ File output;
+
+ /**
+ * The list of transformers to be applied to each input specification.
+ */
+ @Parameter(required = true)
+ final List pipeline = new ArrayList<>();
+
+ /**
+ * File name mappers used to generate the output file name, instances of
+ * {@code org.codehaus.plexus.components.io.filemappers.FileMapper}.
+ *
+ *
+ * The following mappers can be used without needing to specify the FQCN of the implementation.
+ *