Skip to content

Commit 059c69d

Browse files
fix: openapi publication (eclipse-tractusx#698) [skip ci]
1 parent f7441b7 commit 059c69d

File tree

5 files changed

+21
-539
lines changed

5 files changed

+21
-539
lines changed

.github/workflows/publish-swaggerhub.yaml

+18-6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ on:
3131
required: false
3232
type: string
3333

34+
workflow_dispatch:
35+
inputs:
36+
downstream-version:
37+
required: false
38+
description: "Version of the Tractus-X EDC API to be should be published"
39+
type: string
40+
upstream-version:
41+
required: false
42+
description: "Version of upstream EDC which is to be used"
43+
type: string
44+
3445
jobs:
3546
swagger-api:
3647
runs-on: ubuntu-latest
@@ -50,38 +61,39 @@ jobs:
5061
- name: Setup node
5162
uses: actions/setup-node@v3
5263

53-
- name: Install tools
64+
- name: Install Swagger CLI
5465
run: |
5566
npm i -g swaggerhub-cli
5667
5768
- name: Extract versions
5869
run: |
5970
if [ -z ${{ inputs.downstream-version }} ]; then
60-
export DOWNSTREAM_VERSION=$(sed -nr "{ :l /^version[ ]*=/ { s/[^=]*=[ ]*//; p; q;}; n; b l;}" ./gradle.properties | tr -d ' ' | tr -d '"')
71+
export DOWNSTREAM_VERSION=$(grep "version" gradle.properties | awk -F= '{print $2}')
6172
else
6273
export DOWNSTREAM_VERSION=${{ inputs.downstream-version }}
6374
fi
6475
6576
if [ -z ${{ inputs.upstream-version }} ]; then
66-
export UPSTREAM_VERSION=$(sed -nr "/^\[versions\]/ { :l /^edc[ ]*=/ { s/[^=]*=[ ]*//; p; q;}; n; b l;}" ./gradle/libs.versions.toml | tr -d ' ' | tr -d '"')-SNAPSHOT
77+
export UPSTREAM_VERSION=$(grep "edc = " gradle/libs.versions.toml | awk -F= '{print $2}' | jq -r)
6778
else
6879
export UPSTREAM_VERSION=${{ inputs.upstream-version }}
6980
fi
7081
7182
- name: Resolve TX EDC API Spec
7283
shell: bash
7384
run: |
74-
./gradlew :edc-extensions:dataplane-proxy:edc-dataplane-proxy-provider-api:resolve
75-
./gradlew :edc-extensions:dataplane-proxy:edc-dataplane-proxy-consumer-api:resolve
85+
./gradlew resolve
7686
7787
- name: Download upstream API specs
7888
run: |
89+
mkdir -p resources/openapi/yaml
7990
swaggerhub api:get eclipse-edc-bot/management-api/${{ env.UPSTREAM_VERSION }} > resources/openapi/yaml/upstream-management-api.yaml
8091
swaggerhub api:get eclipse-edc-bot/control-api/${{ env.UPSTREAM_VERSION }} > resources/openapi/yaml/upstream-control-api.yaml
92+
ls -lnash resources/openapi/yaml
8193
8294
- name: Merge API specs
8395
run: |
84-
./gradlew -PapiTitle="tractusx-edc-api" -PapiDescription="Tractus EDC API Doc" :mergeApiSpec --input=./resources/openapi/yaml --output=./resources/openapi/yaml/tractusx-edc-api.yaml
96+
./gradlew -PapiTitle="Tractus-X EDC REST API" -PapiDescription="Tractus-X EDC API Documentation" :mergeApiSpec --input=./resources/openapi/yaml --output=./resources/openapi/yaml/tractusx-edc-api.yaml
8597
8698
# create API, will fail if exists
8799
- name: Create API

.github/workflows/publish.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,6 @@ jobs:
135135
permissions:
136136
contents: read
137137
needs: [ secret-presence ]
138-
if: needs.secret-presence.output.HAS_SWAGGER
138+
if: needs.secret-presence.outputs.HAS_SWAGGER
139139
uses: ./.github/workflows/publish-swaggerhub.yaml
140+
secrets: inherit

edc-extensions/bpn-validation/bpn-validation-api/src/main/java/org/eclipse/tractusx/edc/api/bpn/BusinessPartnerGroupApi.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.ID;
4040

4141
@OpenAPIDefinition(info = @Info(description = "With this API clients can create, read, update and delete BusinessPartnerNumber groups. It allows the assigning of BPNs to groups.", title = "Business Partner Group API"))
42-
@Tag(name = "BusinessPartnerGroup")
42+
@Tag(name = "Business Partner Group")
4343
public interface BusinessPartnerGroupApi {
4444

4545

resources/openapi/yaml/edc-dataplane-proxy-consumer-api.yaml

-43
This file was deleted.

0 commit comments

Comments
 (0)