Skip to content

Commit 6a963fc

Browse files
authored
ci: setup automated schema updates for registryinstance/v1 (#631)
* ci: setup automated schema updates for registryinstance/v1 * chore: update registry instance openapi file name
1 parent 9d9286c commit 6a963fc

4 files changed

Lines changed: 12 additions & 33 deletions

File tree

.github/workflows/push_registry_sdk.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/update_openapi.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- "https://raw.githubusercontent.com/bf2fc6cc711aee1a0c2a/kas-fleet-manager/main/openapi/connector_mgmt.yaml"
1515
- "https://raw.githubusercontent.com/bf2fc6cc711aee1a0c2a/srs-fleet-manager/main/core/src/main/resources/srs-fleet-manager.json"
1616
- "https://raw.githubusercontent.com/5733d9e2be6485d52ffa08870cabdee0/sandbox/main/openapi/smartevents_mgmt_v2.yaml"
17+
- "https://raw.githubusercontent.com/Apicurio/apicurio-registry/main/app/src/main/resources-unfiltered/META-INF/resources/api-specifications/registry/v2/openapi-gen.json"
1718

1819

1920
jobs:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
accountmgmt/apiv1/client/docs
2-
.vscode
2+
.vscode
3+
.idea

scripts/fetch_api.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22

33
# get the download URL of the OpenAPI spec file
44
OPENAPI_FILE_URL=$1
5-
OPENAPI_FILE_NAME=$(dirname $0)/../.openapi/$(basename $OPENAPI_FILE_URL)
5+
OPENAPI_FILE_NAME=$(basename $OPENAPI_FILE_URL)
6+
7+
# Special case when downloading Service Registry Instance schema file,
8+
# to keep the original (manually updated) file name.
9+
if [ $OPENAPI_FILE_NAME == "openapi-gen.json" ]; then
10+
OPENAPI_FILE_NAME="registry-instance.json"
11+
fi
12+
OPENAPI_FILE_TARGET=$(dirname $0)/../.openapi/$OPENAPI_FILE_NAME
613

714
# download the OpenAPI file
8-
curl "$OPENAPI_FILE_URL" --output $OPENAPI_FILE_NAME
15+
curl "$OPENAPI_FILE_URL" --output $OPENAPI_FILE_TARGET
916
if [ $? != 0 ]; then
1017
exit $?
1118
fi
12-
13-

0 commit comments

Comments
 (0)