Skip to content

Commit

Permalink
chore: upgrade openapi-generator to v7.10.0 (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctreatma authored Feb 12, 2025
1 parent 49546a6 commit fa45a77
Show file tree
Hide file tree
Showing 103 changed files with 1,046 additions and 601 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ services/*/api/
pkg
.certs
.idea/
spec/services/metalv1/temp_merged_spec/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GIT_REPO=equinix-sdk-go
PACKAGE_VERSION=$(shell cat version)
USER_AGENT=${GIT_REPO}/${PACKAGE_VERSION}

OPENAPI_IMAGE_TAG=v7.4.0
OPENAPI_IMAGE_TAG=v7.10.0
OPENAPI_IMAGE=openapitools/openapi-generator-cli:${OPENAPI_IMAGE_TAG}
CRI=docker # nerdctl
CRI_COMMAND_BASE=${CRI} run --rm -u ${CURRENT_UID}:${CURRENT_GID} $(DOCKER_EXTRA_ARGS)
Expand Down
19 changes: 17 additions & 2 deletions Makefile.metalv1
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ clean:
rm -rf $(CODE_DIR)

codegen:
# TODO: fetch the merged (single-file) spec
# instead of merging it here
# *NOTE*: Due to a bug in swagger-parser, we have
# to use v7.4.0 of openapi-generator to merge the
# spec in order to avoid introducing duplicate models
${CRI} run --rm -u ${CURRENT_UID}:${CURRENT_GID} \
-v $(CURDIR):/local \
openapitools/openapi-generator-cli:v7.4.0 \
generate \
-i /local/${SPEC_PATCHED_DIR}/${SPEC_ROOT_FILE} \
-g openapi-yaml \
-p skipOperationExample=true -p outputFile=${SPEC_ROOT_FILE} \
-o /local/${SPEC_BASE_DIR}/${PACKAGE_NAME}/temp_merged_spec

${OPENAPI_GENERATOR} generate -g go \
--package-name ${PACKAGE_NAME} \
--http-user-agent "${USER_AGENT}" \
Expand All @@ -49,8 +63,9 @@ codegen:
-c /local/config/openapi-generator.json \
-t /local/${TEMPLATE_DIR} \
-o /local/${CODE_DIR} \
-i /local/${SPEC_PATCHED_DIR}/${SPEC_ROOT_FILE}

-i /local/${SPEC_BASE_DIR}/${PACKAGE_NAME}/temp_merged_spec/${SPEC_ROOT_FILE}
# -i /local/${SPEC_PATCHED_DIR}/${SPEC_ROOT_FILE} # switch back to this when the temporary merged spec is removed

validate:
${OPENAPI_GENERATOR} validate \
--recommend \
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ module github.com/equinix/equinix-sdk-go

go 1.19

require github.com/stretchr/testify v1.10.0
require (
github.com/stretchr/testify v1.10.0
gopkg.in/validator.v2 v2.0.1
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down
6 changes: 5 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/validator.v2 v2.0.1 h1:xF0KWyGWXm/LM2G1TrEjqOu4pa6coO9AlWSf3msVfDY=
gopkg.in/validator.v2 v2.0.1/go.mod h1:lIUZBlB3Im4s/eYp39Ry/wkR02yOPhZ9IwIRBjuPuG8=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion services/eiav2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat

- API version: 2.0
- Package version: 0.48.0
- Generator version: 7.4.0
- Generator version: 7.10.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
For more information, please visit [https://equinix.com/about/](https://equinix.com/about/)

Expand Down
28 changes: 10 additions & 18 deletions services/eiav2/client.go

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

2 changes: 1 addition & 1 deletion services/eiav2/model_customer_route_ipv4_request.go

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

2 changes: 1 addition & 1 deletion services/eiav2/model_customer_route_ipv6_request.go

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

2 changes: 1 addition & 1 deletion services/eiav2/model_direct_peering_ipv4_request.go

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

2 changes: 1 addition & 1 deletion services/eiav2/model_direct_peering_ipv6_request.go

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

2 changes: 1 addition & 1 deletion services/eiav2/model_error.go

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

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

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

4 changes: 2 additions & 2 deletions services/eiav2/model_routing_protocol_peering_ipv4.go

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

4 changes: 2 additions & 2 deletions services/eiav2/model_routing_protocol_peering_ipv6.go

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

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

14 changes: 14 additions & 0 deletions services/eiav2/utils.go

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

2 changes: 1 addition & 1 deletion services/fabricv4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat

- API version: 4.19
- Package version: 0.48.0
- Generator version: 7.4.0
- Generator version: 7.10.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
For more information, please visit [https://docs.equinix.com/api-support.htm](https://docs.equinix.com/api-support.htm)

Expand Down
10 changes: 5 additions & 5 deletions services/fabricv4/api_cloud_routers.go

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

4 changes: 2 additions & 2 deletions services/fabricv4/api_connections.go

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

Loading

0 comments on commit fa45a77

Please sign in to comment.