Skip to content

Commit

Permalink
Merge pull request #310 from Interhyp/update_openapi
Browse files Browse the repository at this point in the history
Update openapi
  • Loading branch information
mplushnikov authored Jul 9, 2024
2 parents a1929bf + 2424698 commit 8c54967
Show file tree
Hide file tree
Showing 27 changed files with 2,270 additions and 3,322 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/api-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: Legion2/swagger-ui-action@v1
with:
output: swagger-ui
spec-file: api/openapi-v3-spec.json
spec-file: api/openapi-v3-spec.yaml
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ FROM scratch

COPY --from=build /app/main /main
COPY --from=build /etc/ssl/certs /etc/ssl/certs
COPY --from=build /app/api/openapi-v3-spec.json /api/openapi-v3-spec.json
COPY --from=build /app/api/openapi-v3-spec.yaml /api/openapi-v3-spec.yaml

ENTRYPOINT ["/main"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Build Status](https://github.com/interhyp/metadata-service/actions/workflows/go.yaml/badge.svg)](../../actions/workflows/go.yaml)
[![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/interhyp/metadata-service)][release]
[![GitHub Latest Stable Release](https://img.shields.io/github/v/release/interhyp/metadata-service?TODO?label=Stable)][release]
[![Swagger Validator](https://img.shields.io/swagger/valid/3.0?label=swagger&specUrl=https%3A%2F%2Finterhyp.github.io%2Fmetadata-service%2Fapi%2Fopenapi-v3-spec.json)][swagger]
[![Swagger Validator](https://img.shields.io/swagger/valid/3.0?label=swagger&specUrl=https%3A%2F%2Finterhyp.github.io%2Fmetadata-service%2Fapi%2Fopenapi-v3-spec.yaml)][swagger]
[![Codecov](https://img.shields.io/codecov/c/github/interhyp/metadata-service)](https://codecov.io/gh/interhyp/metadata-service)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Expand Down
22 changes: 13 additions & 9 deletions api-generator/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@ if [ -d "api-generator" ]; then
cd api-generator
fi

GENERATOR=openapi-generator-cli-7.5.0_INTERHYP.jar
GENERATOR=openapi-generator-cli-7.7.1_INTERHYP.jar

if [ ! -f "$GENERATOR" ]; then
echo "Please download https://github.com/Interhyp/openapi-generator/blob/new_generator_rebased/bin/openapi-generator-cli-7.5.0_INTERHYP.jar using your browser and save as $GENERATOR"
echo "Please download https://github.com/Interhyp/openapi-generator/blob/new_generator_rebased/bin/openapi-generator-cli-7.7.1_INTERHYP.jar using your browser and save as $GENERATOR"
exit 1
fi

API_MODEL_PACKAGE_NAME=openapi

java -jar $GENERATOR generate \
-i ../api/openapi-v3-spec.json \
-o ../api \
--package-name $API_MODEL_PACKAGE_NAME \
--global-property models \
--additional-properties=enumClassPrefix=true,structPrefix=true \
-g go-autumrest
function generate_apimodel {
java -jar $GENERATOR generate \
-i ../api/openapi-v3-spec.yaml \
-o ../api \
--package-name $API_MODEL_PACKAGE_NAME \
--global-property models \
--additional-properties=enumClassPrefix=true,structPrefix=true \
-g go-autumrest
}

function generate_downstream {
P_DOWNSTREAM_NAME=$1
Expand All @@ -39,6 +41,8 @@ function generate_downstream {
-g go-autumrest
}

generate_apimodel

# -------------------------------------- customization -----------------------------------------
# omit certain fields from yaml representations, which we use internally to save to files in git
# (this information is represented in the directory tree or is part of the commit metadata)
Expand Down
2 changes: 1 addition & 1 deletion api/generated_model_owner_create_dto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/generated_model_owner_dto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/generated_model_owner_patch_dto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/generated_model_repository_configuration_dto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/generated_model_repository_configuration_webhook_dto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/generated_model_repository_create_dto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/generated_model_repository_dto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/generated_model_repository_patch_dto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions api/generated_model_service_create_dto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions api/generated_model_service_dto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions api/generated_model_service_patch_dto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8c54967

Please sign in to comment.