Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: openapi publication #698

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .github/workflows/publish-swaggerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ on:
required: false
type: string

workflow_dispatch:
inputs:
downstream-version:
required: false
description: "Version of the Tractus-X EDC API to be should be published"
type: string
upstream-version:
required: false
description: "Version of upstream EDC which is to be used"
type: string

jobs:
swagger-api:
runs-on: ubuntu-latest
Expand All @@ -50,29 +61,28 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3

- name: Install tools
- name: Install Swagger CLI
run: |
npm i -g swaggerhub-cli

- name: Extract versions
run: |
if [ -z ${{ inputs.downstream-version }} ]; then
export DOWNSTREAM_VERSION=$(sed -nr "{ :l /^version[ ]*=/ { s/[^=]*=[ ]*//; p; q;}; n; b l;}" ./gradle.properties | tr -d ' ' | tr -d '"')
export DOWNSTREAM_VERSION=$(grep "version" gradle.properties | awk -F= '{print $2}')
else
export DOWNSTREAM_VERSION=${{ inputs.downstream-version }}
fi

if [ -z ${{ inputs.upstream-version }} ]; then
export UPSTREAM_VERSION=$(sed -nr "/^\[versions\]/ { :l /^edc[ ]*=/ { s/[^=]*=[ ]*//; p; q;}; n; b l;}" ./gradle/libs.versions.toml | tr -d ' ' | tr -d '"')-SNAPSHOT
export UPSTREAM_VERSION=$(grep "edc = " gradle/libs.versions.toml | awk -F= '{print $2}' | jq -r)
else
export UPSTREAM_VERSION=${{ inputs.upstream-version }}
fi

- name: Resolve TX EDC API Spec
shell: bash
run: |
./gradlew :edc-extensions:dataplane-proxy:edc-dataplane-proxy-provider-api:resolve
./gradlew :edc-extensions:dataplane-proxy:edc-dataplane-proxy-consumer-api:resolve
./gradlew resolve

- name: Download upstream API specs
run: |
Expand All @@ -81,7 +91,7 @@ jobs:

- name: Merge API specs
run: |
./gradlew -PapiTitle="tractusx-edc-api" -PapiDescription="Tractus EDC API Doc" :mergeApiSpec --input=./resources/openapi/yaml --output=./resources/openapi/yaml/tractusx-edc-api.yaml
./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

# create API, will fail if exists
- name: Create API
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,4 @@ jobs:
needs: [ secret-presence ]
if: needs.secret-presence.output.HAS_SWAGGER
uses: ./.github/workflows/publish-swaggerhub.yaml
secrets: inherit
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.ID;

@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"))
@Tag(name = "BusinessPartnerGroup")
@Tag(name = "Business Partner Group")
public interface BusinessPartnerGroupApi {


Expand Down
43 changes: 0 additions & 43 deletions resources/openapi/yaml/edc-dataplane-proxy-consumer-api.yaml

This file was deleted.

Loading