From b9da83f7aa4c70ece6814f5b9c6cc7833bb8861f Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 14 Nov 2023 17:42:57 +0100 Subject: [PATCH] feat(irs):[#209] Update IRS API Swagger documentation to match AAS 3.0.0 --- AUTHORS.md | 4 +- CHANGELOG.md | 3 +- .../irs/configuration/OpenApiExamples.java | 37 +++++++++++-------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 1206cc2470..12e875f6dc 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -15,4 +15,6 @@ The following people have contributed to this repository: - Michael Schlacher, doubleSlash Net-Business GmbH, https://github.com/michaelschlacher2 - Sebastian Bezold, Mercedes Benz AG, https://github.com/SebastianBezold - Zied Belkhiria, MHP, https://github.com/Zied-Belkhiria-Mhp -- Adam Bugajewski, doubleSlash Net-Business GmbH, https://github.com/ds-ext-abugajewski \ No newline at end of file +- Adam Bugajewski, doubleSlash Net-Business GmbH, https://github.com/ds-ext-abugajewski +- Matthias Fischer, doubleSlash Net-Business GmbH, https://github.com/dsmf + diff --git a/CHANGELOG.md b/CHANGELOG.md index f9ccccf514..66a7c10649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - IRS can now check the readiness of external services. Use the new ``management.health.dependencies.enabled`` config entry to determine if external dependencies health checks should be checked (false by default). - The map of external services healthcheck endpoints can be configured with ``management.health.dependencies.urls`` property, eg. ``service_name: http://service_name_host/health`` +- Update IRS API Swagger documentation to match AAS 3.0.0 ## [4.0.1] - 2023-11-10 ### Changed @@ -450,4 +451,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [1.1.0]: https://github.com/eclipse-tractusx/item-relationship-service/compare/v1.0.0...v1.1.0 [1.0.0]: https://github.com/eclipse-tractusx/item-relationship-service/compare/v0.9.1...v1.0.0 [0.9.1]: https://github.com/eclipse-tractusx/item-relationship-service/commits/v0.9.1 -[0.9.0]: https://github.com/eclipse-tractusx/item-relationship-service/commits/v0.9.0 \ No newline at end of file +[0.9.0]: https://github.com/eclipse-tractusx/item-relationship-service/commits/v0.9.0 diff --git a/irs-api/src/main/java/org/eclipse/tractusx/irs/configuration/OpenApiExamples.java b/irs-api/src/main/java/org/eclipse/tractusx/irs/configuration/OpenApiExamples.java index 0d5acc73cc..b1d5e7a4dd 100644 --- a/irs-api/src/main/java/org/eclipse/tractusx/irs/configuration/OpenApiExamples.java +++ b/irs-api/src/main/java/org/eclipse/tractusx/irs/configuration/OpenApiExamples.java @@ -141,12 +141,12 @@ private Example createAspectModelsResult() { .type("BAMM") .build(); final AspectModel serialPart = AspectModel.builder() - .name("SerialPart") - .urn("urn:bamm:io.catenax.serial_part:1.0.0#SerialPart") - .version("1.0.0") - .status("RELEASED") - .type("BAMM") - .build(); + .name("SerialPart") + .urn("urn:bamm:io.catenax.serial_part:1.0.0#SerialPart") + .version("1.0.0") + .status("RELEASED") + .type("BAMM") + .build(); return toExample(AspectModels.builder() .lastUpdated("2023-02-13T08:18:11.990659500Z") @@ -275,8 +275,12 @@ private Example createCompleteEssJobResult() { .submodel(createEssSubmodel()) .bpn(Bpn.withManufacturerId(EXAMPLE_BPN).updateManufacturerName("AB CD")) .build(); - final NotificationSummary newSummary = new NotificationSummary( - AsyncFetchedItems.builder().running(NO_RUNNING_OR_FAILED_ITEMS).completed(FETCHED_ITEMS_SIZE).failed(NO_RUNNING_OR_FAILED_ITEMS).build(), + final NotificationSummary newSummary = new NotificationSummary(AsyncFetchedItems.builder() + .running( + NO_RUNNING_OR_FAILED_ITEMS) + .completed(FETCHED_ITEMS_SIZE) + .failed(NO_RUNNING_OR_FAILED_ITEMS) + .build(), FetchedItems.builder().completed(FETCHED_ITEMS_SIZE).failed(NO_RUNNING_OR_FAILED_ITEMS).build(), SENT_NOTIFICATIONS_SIZE, SENT_NOTIFICATIONS_SIZE); final Job job = essJobsJobs.getJob().toBuilder().summary(newSummary).build(); @@ -381,7 +385,7 @@ private AssetAdministrationShellDescriptor createShell() { .build())) .globalAssetId("urn:uuid:a45a2246-f6e1-42da-b47d-5c3b58ed62e9") .idShort("future concept x") - .id("882fc530-b69b-4707-95f6-5dbc5e9baaa8") + .id("urn:uuid:882fc530-b69b-4707-95f6-5dbc5e9baaa8") .specificAssetIds(List.of(IdentifierKeyValuePair.builder() .name("engineserialid") .value("12309481209312") @@ -427,12 +431,12 @@ private SubmodelDescriptor createBaseSubmodelDescriptor() { .language("en") .text("Provides base vehicle information") .build())) - .idShort("vehicle base details") - .id("4a738a24-b7d8-4989-9cd6-387772f40565") + .idShort("SingleLevelBomAsPlanned") + .id("urn:uuid:5d25a897-6571-4800-b98c-a3352fbf996d") .semanticId(Reference.builder() .keys(List.of(SemanticId.builder() - .type("Submodel") - .value("urn:bamm:com.catenax.vehicle:0.1.1") + .type("ExternalReference") + .value("urn:bamm:io.catenax.single_level_bom_as_planned:2.0.0#SingleLevelBomAsPlanned") .build())) .type("ModelReference") .build()) @@ -447,6 +451,10 @@ private Endpoint createEndpoint(final String endpointAddress) { .href(endpointAddress) .endpointProtocol("HTTPS") .endpointProtocolVersion(List.of("1.0")) + .subprotocol("DSP") + .subprotocolBody( + "id=urn:uuid:c8159379-4613-48b8-ad52-6baed7afe923;dspEndpoint=https://irs-provider-controlplane3.dev.demo.catena-x.net") + .subprotocolBodyEncoding("plain") .build()) .build(); } @@ -457,8 +465,7 @@ private SubmodelDescriptor createPartSubmodelDescriptor() { .language("en") .text("Provides base vehicle information") .build())) - .idShort("vehicle part details") - .id("dae4d249-6d66-4818-b576-bf52f3b9ae90") + .idShort("vehicle part details").id("urn:uuid:dae4d249-6d66-4818-b576-bf52f3b9ae90") .semanticId(Reference.builder() .keys(List.of(SemanticId.builder() .type("Submodel")