diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..44e95d1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +service-sdk/12.1.0/.idea/ diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/README.md b/service-sdk/12.0.0/create-outbound-integration-service-openapi/README.md new file mode 100644 index 0000000..cb527a3 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/README.md @@ -0,0 +1,4 @@ +This project contains code samples documented in the following sections in [Backbase Community](https://community.backbase.com/documentation/ServiceSDK/latest/index) + +* [Integrate your service with an external service](https://community.backbase.com/documentation/ServiceSDK/latest/create_outbound_integration_service) +* [Enable service to service communications](https://community.backbase.com/documentation/ServiceSDK/latest/service_to_service_communication) diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/.gitignore b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/.gitignore new file mode 100644 index 0000000..07f7fb1 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/.gitignore @@ -0,0 +1,26 @@ +**/*.iml +**/*.ipr +**/*.iws +**/*.log +**/.classpath +**/.idea/ +**/.project +**/.settings +**/target/ +**/*.class + +# General +.DS_Store +.AppleDouble +.LSOverride + + +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ \ No newline at end of file diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/README.md b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/README.md new file mode 100644 index 0000000..02acd45 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/README.md @@ -0,0 +1,45 @@ +# example-integration-service + +_Fill out this file with some information about your Service._ + +#Getting Started +* [Extend and build](https://community.backbase.com/documentation/ServiceSDK/latest/extend_and_build) + +## Dependencies + +Requires a running Eureka registry, by default on port 8080. + +## Configuration + +Service configuration is under `src/main/resources/application.yml`. + +## Running + +To run the service in development mode, use: +- `mvn spring-boot:run` + +To run the service from the built binaries, use: +- `java -jar target/example-integration-service-1.0.0-SNAPSHOT.jar` + +## Authorization + +Requests to this service are authorized with a Backbase Internal JWT, therefore you must access this service via the +Backbase Gateway after authenticating with the authentication service. + +For local development, an internal JWT can be created from http://jwt.io, entering `JWTSecretKeyDontUseInProduction!` +as the secret in the signature to generate a valid signed JWT. + +## Community Documentation + +Add links to documentation including setup, config, etc. + +## Jira Project + +Add link to Jira project. + +## Confluence Links +Links to relevant confluence pages (design etc). + +## Support + +The official example-integration-service support room is [#s-example-integration-service](https://todo). diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/pom-as-dependency.xml b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/pom-as-dependency.xml new file mode 100644 index 0000000..c1c9e03 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/pom-as-dependency.xml @@ -0,0 +1,102 @@ + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 2.3.8.RELEASE + + + + com.backbase.example + example-integration-service + 1.0.0-SNAPSHOT + war + Backbase :: Digital Banking Services :: example-integration-service + + + 11 + + + + + + com.backbase.buildingblocks + 12.1.0 + service-sdk-starter-core + pom + import + + + + + + + + + + + com.backbase.buildingblocks + service-sdk-starter-core + pom + + + com.backbase.buildingblocks + service-sdk-starter-test + test + + + + + + + + + + diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/pom.xml b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/pom.xml new file mode 100644 index 0000000..5cedfe2 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/pom.xml @@ -0,0 +1,132 @@ + + 4.0.0 + + + + com.backbase.buildingblocks + 12.1.0 + service-sdk-starter-core + + + + com.backbase.example + example-integration-service + 1.0.0-SNAPSHOT + war + Backbase :: example-integration-service + + + 11 + 0.14.1 + ${project.build.directory}/specs + + 1.6.2 + 0.2.1 + + + + + com.backbase.buildingblocks + service-sdk-starter-test + test + + + + + + + + com.backbase.buildingblocks + communication + + + com.backbase.buildingblocks + service-sdk-starter-mapping + + + com.backbase.buildingblocks + service-sdk-test-utils + test + + + io.swagger + swagger-annotations + ${swagger-annotations.version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable.version} + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + unpack + initialize + + unpack + + + + + com.backbase.poc + example-integration-spec + 1.0.0-SNAPSHOT + jar + ${open-api-specs-dir}/example-integration-spec/ + **/*.yaml,**/*.json + + + **/*.java + **/*.properties + ${project.build.directory}/wars + false + true + + + + + + + + + com.backbase.oss + boat-maven-plugin + ${boat-maven-plugin.version} + + + + generate-payment-order-template-client-api-code + + generate-spring-boot-embedded + + generate-sources + + + ${open-api-specs-dir}/example-integration-spec/client-api-v1.yaml + + com.backbase.example.api.client.v1 + com.backbase.example.api.client.v1.model + + + + + + + + + diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/Application.java b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/Application.java new file mode 100644 index 0000000..37acffd --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/Application.java @@ -0,0 +1,16 @@ +package com.backbase.example; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@SpringBootApplication +@EnableDiscoveryClient +public class Application extends SpringBootServletInitializer { + + public static void main(final String[] args) { + SpringApplication.run(Application.class, args); + } + +} \ No newline at end of file diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/ExampleController.java b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/ExampleController.java new file mode 100644 index 0000000..b15039a --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/ExampleController.java @@ -0,0 +1,62 @@ +package com.backbase.example; + +import com.backbase.buildingblocks.presentation.errors.InternalServerErrorException; +import com.backbase.example.api.client.v1.MessageApi; +import com.backbase.example.api.client.v1.model.MessagePostResponseBody; +import com.backbase.example.integration.MessageClient; +import com.backbase.example.mapper.IntegrationMessageMapper; +import com.backbase.example.model.Message; +import java.io.IOException; +import java.util.List; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class ExampleController implements MessageApi { + + @Autowired + private MessageClient messageClient; + + @Override + public ResponseEntity deleteMessage(@Valid @NotNull String id) { + return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build(); + } + + + @Override + public ResponseEntity getMessage(@Valid @NotNull String id) { + + return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build(); + } + + // tag::getIntegration[] + @Override + public ResponseEntity> getMessages() { + List messages = null; + + try { + messages = messageClient.getMessages(); + } catch (IOException e) { + throw new InternalServerErrorException("Error has occurred sending message"); + } + + return ResponseEntity.ok(IntegrationMessageMapper.INSTANCE.messagesToIntegrationGetResponseBodys(messages)); + } + // end::getIntegration[] + + @Override + public ResponseEntity postMessage( + com.backbase.example.api.client.v1.model.@Valid Message message) { + return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build(); + } + + @Override + public ResponseEntity putMessage(com.backbase.example.api.client.v1.model.@Valid Message message) { + return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build(); + } + +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/Message.java b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/Message.java new file mode 100644 index 0000000..8def353 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/Message.java @@ -0,0 +1,17 @@ +package com.backbase.example; + +public class Message { + private String message; + + public Message(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/integration/MessageClient.java b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/integration/MessageClient.java new file mode 100644 index 0000000..93214dc --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/integration/MessageClient.java @@ -0,0 +1,11 @@ +package com.backbase.example.integration; + +import com.backbase.example.model.Message; + +import java.io.IOException; +import java.util.List; + +public interface MessageClient { + + List getMessages() throws IOException; +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/integration/MessageClientImpl.java b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/integration/MessageClientImpl.java new file mode 100644 index 0000000..816bb42 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/integration/MessageClientImpl.java @@ -0,0 +1,41 @@ +package com.backbase.example.integration; + +import com.backbase.example.model.Message; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.http.HttpMethod; +import org.springframework.stereotype.Service; +import org.springframework.web.client.RestTemplate; + +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; + +@Service +public class MessageClientImpl implements MessageClient { + + private static final String SERVICE_URL = "http://echo.jsontest.com/messageId/abcdef-393939-dffdfdf/message/Hello%20World/"; + private RestTemplate restTemplate; + + public MessageClientImpl(RestTemplateBuilder restTemplateBuilder) { + restTemplate = restTemplateBuilder.build(); + } +// tag::getMessages[] + @Override + public List getMessages() throws IOException { + /** NOTE: This integration could be completed by creating a code generated client e.g. off a Open API spec */ + String responseJSON = restTemplate.exchange( + URI.create(SERVICE_URL), + HttpMethod.GET, null, String.class).getBody(); + + Message message = new ObjectMapper().readValue(responseJSON, + new TypeReference() {}); + + List messages = new ArrayList<>(); + messages.add(message); + return messages; + } +// end::getMessages[] +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/mapper/IntegrationMessageMapper.java b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/mapper/IntegrationMessageMapper.java new file mode 100644 index 0000000..cb6fab9 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/mapper/IntegrationMessageMapper.java @@ -0,0 +1,18 @@ +package com.backbase.example.mapper; + +import com.backbase.example.model.Message; +import java.util.List; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface IntegrationMessageMapper { + + IntegrationMessageMapper INSTANCE = Mappers.getMapper( IntegrationMessageMapper.class); + + @Mapping(source = "messages.messageId", target = "id") + com.backbase.example.api.client.v1.model.Message messageToIntegrationGetResponseBody(Message messages); + + List messagesToIntegrationGetResponseBodys(List messages); +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/model/Message.java b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/model/Message.java new file mode 100644 index 0000000..3eed06b --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/java/com/backbase/example/model/Message.java @@ -0,0 +1,43 @@ +package com.backbase.example.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.annotation.Generated; +import javax.validation.constraints.NotNull; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "messageId", + "message" +}) +@JsonIgnoreProperties(ignoreUnknown = true) +public class Message { + + @JsonProperty("messageId") + @NotNull + private String messageId; + + @JsonProperty("message") + @NotNull + private String message; + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/resources/application.yml b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/resources/application.yml new file mode 100644 index 0000000..9b286a6 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/resources/application.yml @@ -0,0 +1,27 @@ +server: + port: 9915 + +# API Registry client configuration +eureka: + instance: + metadata-map: + public: true + role: live + client: + serviceUrl: + defaultZone: http://localhost:8080/registry/eureka/ + +# Configure Internal JWT handler +sso: + jwt: + internal: + signature: + key: + type: ENV + value: SIG_SECRET_KEY + +# Spring health monitoring +management: + health: + jms: + enabled: false \ No newline at end of file diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/resources/banner.txt b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/resources/banner.txt new file mode 100644 index 0000000..3e84197 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/resources/banner.txt @@ -0,0 +1,9 @@ + ________ ________ ________ ___ __ ________ ________ ________ _______ +|\ __ \|\ __ \|\ ____\|\ \|\ \ |\ __ \|\ __ \|\ ____\|\ ___ \ +\ \ \|\ /\ \ \|\ \ \ \___|\ \ \/ /|\ \ \|\ /\ \ \|\ \ \ \___|\ \ __/| + \ \ __ \ \ __ \ \ \ \ \ ___ \ \ __ \ \ __ \ \_____ \ \ \_|/__ + \ \ \|\ \ \ \ \ \ \ \____\ \ \\ \ \ \ \|\ \ \ \ \ \|____|\ \ \ \_|\ \ + \ \_______\ \__\ \__\ \_______\ \__\\ \__\ \_______\ \__\ \__\____\_\ \ \_______\ + \|_______|\|__|\|__|\|_______|\|__| \|__|\|_______|\|__|\|__|\_________\|_______| + \|_________| + diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/resources/bootstrap.yml b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..4212129 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/main/resources/bootstrap.yml @@ -0,0 +1,3 @@ +spring: + application: + name: example-integration-service diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/test/java/com/backbase/example/ExampleControllerIT.java b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/test/java/com/backbase/example/ExampleControllerIT.java new file mode 100644 index 0000000..9be8800 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/src/test/java/com/backbase/example/ExampleControllerIT.java @@ -0,0 +1,77 @@ +package com.backbase.example; + + +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.junit.Assert.assertThat; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import com.backbase.buildingblocks.testutils.TestTokenUtil; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.ResultActions; +import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; + +/** + * A wrapper annotation for use with integration tests. + *

+ * By default, assumes the integration test modifies the {@link ApplicationContext} associated with the test/s and will + * therefore be closed and removed from the context cache at the end of the class. + */ +@SpringBootTest(classes = Application.class) +@DirtiesContext(classMode = ClassMode.AFTER_CLASS) +@RunWith(SpringJUnit4ClassRunner.class) +@AutoConfigureMockMvc +@ActiveProfiles("it") +public class ExampleControllerIT { + + public static final String TEST_JWT = + "{\n" + + " \"Role\" : [\n" + + " \"Manager\",\n" + + " \"Project Administrator\"\n" + + " ],\n" + + " \"inuid\" : \"Jimmy\",\n" + + " \"aud\" : \"www.example.com\",\n" + + " \"sub\" : \"jrocket@example.com\",\n" + + " \"Email\" : \"jrocket@example.com\",\n" + + " \"iss\" : \"Online JWT Builder\",\n" + + " \"GivenName\" : \"Johnny\",\n" + + " \"exp\" : 1516356196,\n" + + " \"iat\" : 1484820196,\n" + + " \"Surname\" : \"Rocket\"\n" + + "}"; + @Autowired + private MockMvc mvc; + + @Test + public void exampleTest() throws Exception { + MockHttpServletRequestBuilder requestBuilder = get("/client-api/v1/all-messages") + .header("Authorization", "Bearer "+TestTokenUtil.encode(TEST_JWT)); + + ResultActions result = mvc.perform(requestBuilder); + + // Then the request is successful + result.andExpect(status().isOk()); + + List message = new ObjectMapper() + .readValue(result.andReturn().getResponse().getContentAsString(), + new TypeReference>() { + }); + + assertThat(message, notNullValue()); + assertThat(message.get(0).getMessage(), notNullValue()); + assertThat(message.get(0).getId(), notNullValue()); + } +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/.gitignore b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/.gitignore new file mode 100644 index 0000000..8fcb18f --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/.gitignore @@ -0,0 +1,8 @@ +/target +.DS_Store +.idea +*.iml +/src/main/java +/src/main/resources/lib +node_modules +fe-dist diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/README.md b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/README.md new file mode 100644 index 0000000..5a9c77a --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/README.md @@ -0,0 +1,25 @@ +# Example Integration Service API Spec + +> _Fill out this file with some information about your OpenAPI spec._ + +To build this spec, use: +``` +mvn clean install +``` + +The spec is also validated as part of the build. + +## Community Documentation + +Add links to documentation including setup, config, etc. + +##Jira Project + +Add link to Jira project. + +## Confluence Links +Links to relevant confluence pages (design etc). + +## Support + +Slack, Email, Jira etc. \ No newline at end of file diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/pom.xml b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/pom.xml new file mode 100644 index 0000000..a6ad526 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/pom.xml @@ -0,0 +1,96 @@ + + + 4.0.0 + + + com.backbase.buildingblocks + backbase-openapi-spec-starter-parent + 12.1.0 + + + com.backbase.poc + example-integration-spec + 1.0.0-SNAPSHOT + Backbase :: Example Integration Service API Spec + + + + 0.14.1 + + + + + + com.backbase.oss + boat-tmaven-plugin + ${boat-maven-plugin.version} + + + boat-validation + generate-sources + + validate + + + ${project.basedir}/src/main/resources/client-api-v1.yaml + true + + + + + boat-bundle + generate-sources + + bundle + + + ${project.basedir}/src/main/resources + ${project.build.directory} + true + + + + + boat-bundle-unversioned + generate-sources + + bundle + + + ${project.basedir}/src/main/resources + ${project.build.directory}/unversioned + false + + + + boat-linting + package + + lint + + + ${project.build.directory} + ${project.basedir}/target/boat-lint-reports + true + true + + + + boat-docs + package + + generate + + + ${project.build.directory}/unversioned/client-api-v1.yaml + ${project.build.directory}/generated-docs + html2 + true + + + + + + + diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/client-api-v1.yaml b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/client-api-v1.yaml new file mode 100644 index 0000000..297e773 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/client-api-v1.yaml @@ -0,0 +1,169 @@ +openapi: 3.0.3 +info: + title: Message Service API Spec + description: Specs for Message Service API + version: 1.0.0 + x-icon: credit_card + +servers: + - description: local test + url: http://localhost:8080/api/v1 + +tags: + - name: Retail + +paths: + + /client-api/v1/messages: + description: No description available + + get: + summary: Returns available items, optionally filtered by name. + description: Returns available items, optionally filtered by name + operationId: getMessage + parameters: + - description: Id of the message record + example: a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1 + in: query + name: id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + example: + $ref: examples/body/example-message.json + schema: + $ref: '#/components/schemas/Message' + description: No description available + '400': + $ref: 'lib/common-types.yaml#/components/responses/400BadRequest' + '500': + $ref: 'lib/common-types.yaml#/components/responses/500InternalServerError' + tags: + - message + + delete: + summary: Delete message. + description: Deletes a message + operationId: deleteMessage + parameters: + - description: Id of the message record + example: a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1 + in: query + name: id + required: true + schema: + type: string + responses: + '204': + description: request to delete completed + '400': + $ref: 'lib/common-types.yaml#/components/responses/400BadRequest' + '500': + $ref: 'lib/common-types.yaml#/components/responses/500InternalServerError' + tags: + - message + + post: + summary: Adds or updates a message. + description: Adds or updates a message + operationId: postMessage + requestBody: + content: + application/json: + example: + $ref: examples/body/example-message.json + schema: + $ref: '#/components/schemas/Message' + description: Adds or updates a message + responses: + '201': + content: + application/json: + example: + $ref: examples/body/example-message-created.json + schema: + $ref: '#/components/schemas/MessagePostResponseBody' + description: request to create item accepted + '400': + $ref: 'lib/common-types.yaml#/components/responses/400BadRequest' + '500': + $ref: 'lib/common-types.yaml#/components/responses/500InternalServerError' + tags: + - message + + put: + summary: Adds or updates a message. + description: Adds or updates a message + operationId: putMessage + requestBody: + content: + application/json: + example: + $ref: examples/body/example-message.json + schema: + $ref: '#/components/schemas/Message' + description: Adds or updates a message + responses: + '204': + description: request to update item completed + '400': + $ref: 'lib/common-types.yaml#/components/responses/400BadRequest' + '500': + $ref: 'lib/common-types.yaml#/components/responses/500InternalServerError' + tags: + - message + + /client-api/v1/all-messages: + summary: messages + description: No description available + get: + summary: Returns all available messages. + description: Returns all available messages + operationId: getMessages + responses: + '200': + content: + application/json: + example: + $ref: examples/body/example-messages-get.json + schema: + $ref: '#/components/schemas/MessagesGetResponseBody' + description: No description available + '400': + $ref: 'lib/common-types.yaml#/components/responses/400BadRequest' + '500': + $ref: 'lib/common-types.yaml#/components/responses/500InternalServerError' + tags: + - message + +components: + schemas: + ErrorItem: + $ref: 'lib/schemas/error-item.yaml' + Message: + $ref: schemas/body/message.json + MessagesGetResponseBody: + $ref: schemas/body/messages-get.json + MessagePostResponseBody: + $ref: schemas/body/message-created.json + NotAcceptableError: + properties: + message: + type: string + supportedMediaTypes: + description: List of supported media types for this endpoint + items: + type: string + type: array + type: object + UnauthorizedError: + properties: + message: + type: string + required: + - message + type: object diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/docs/api.md b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/docs/api.md new file mode 100644 index 0000000..3365a26 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/docs/api.md @@ -0,0 +1,7 @@ +# Example Persistence Service API Spec API Documentation + +Currently the Example Persistence Service API Spec API contains the following operations: +* Create an item or Update an item +* Get an item by ID +* Get list of items, optionally filtering by name +* Delete item diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/examples/body/example-message-created.json b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/examples/body/example-message-created.json new file mode 100644 index 0000000..66dc6ed --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/examples/body/example-message-created.json @@ -0,0 +1,3 @@ +{ + "id": "a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1" +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/examples/body/example-message.json b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/examples/body/example-message.json new file mode 100644 index 0000000..03564aa --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/examples/body/example-message.json @@ -0,0 +1,4 @@ +{ + "id": "a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1", + "message": "Hello" +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/examples/body/example-messages-get.json b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/examples/body/example-messages-get.json new file mode 100644 index 0000000..bfcbcd8 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/examples/body/example-messages-get.json @@ -0,0 +1,14 @@ +[ + { + "id": "a5b0fe7d-c4dd-40a7-bd80-dfc7869327e1", + "message": "Hello" + }, + { + "id": "d593c212-70ad-41a6-a547-d5d9232414cb", + "message": "Hola" + }, + { + "id": "9635966b-28e9-4479-8121-bb7bc9beeb62", + "message": "hej" + } +] diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/examples/errors/example-error.json b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/examples/errors/example-error.json new file mode 100644 index 0000000..2904b69 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/examples/errors/example-error.json @@ -0,0 +1,3 @@ +{ + "message": "Description of error" +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/schemas/body/message-created.json b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/schemas/body/message-created.json new file mode 100644 index 0000000..0f30393 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/schemas/body/message-created.json @@ -0,0 +1,8 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + } + } +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/schemas/body/message.json b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/schemas/body/message.json new file mode 100644 index 0000000..74fd94d --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/schemas/body/message.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "id", + "message" + ] +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/schemas/body/messages-get.json b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/schemas/body/messages-get.json new file mode 100644 index 0000000..00778c9 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/schemas/body/messages-get.json @@ -0,0 +1,6 @@ +{ + "type": "array", + "items": { + "$ref": "message.json" + } +} diff --git a/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/schemas/errors/error.json b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/schemas/errors/error.json new file mode 100644 index 0000000..5c30948 --- /dev/null +++ b/service-sdk/12.0.0/create-outbound-integration-service-openapi/example-integration-spec/src/main/resources/schemas/errors/error.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ] +}