Skip to content

Commit

Permalink
oapi-codegen v1.11対応 (#54)
Browse files Browse the repository at this point in the history
phy-api-goでの[oapi-codegen v1.11対応](https://github.com/sacloud/phy-api-go/pull/101)と同様の対応
さらにcompatibilityにold-aliasing: trueを追加してエラーを回避している。
  • Loading branch information
yamamoto-febc authored Jun 29, 2022
1 parent 8b8ea4c commit 6c752a6
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 186 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ include includes/go/common.mk
include includes/go/single.mk
#====================

default: $(DEFAULT_GOALS)
default: gen $(DEFAULT_GOALS)
tools: dev-tools

.PHONY: tools
tools: dev-tools
npm install -g @apidevtools/swagger-cli
go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.9.0
go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.11.0

.PHONY: clean-all
clean-all:
Expand All @@ -54,13 +54,13 @@ apis/v1/spec/swagger.json: apis/v1/spec/swagger.yaml
swagger-cli bundle apis/v1/spec/swagger.yaml -o apis/v1/spec/swagger.json --type json

apis/v1/zz_types_gen.go: apis/v1/spec/swagger.yaml apis/v1/spec/codegen/types.yaml
oapi-codegen -config apis/v1/spec/codegen/types.yaml apis/v1/spec/swagger.yaml
oapi-codegen --old-config-style -config apis/v1/spec/codegen/types.yaml apis/v1/spec/swagger.yaml

apis/v1/zz_client_gen.go: apis/v1/spec/swagger.yaml apis/v1/spec/codegen/client.yaml
oapi-codegen -config apis/v1/spec/codegen/client.yaml apis/v1/spec/swagger.yaml
oapi-codegen --old-config-style -config apis/v1/spec/codegen/client.yaml apis/v1/spec/swagger.yaml

apis/v1/zz_server_gen.go: apis/v1/spec/swagger.yaml apis/v1/spec/codegen/gin.yaml
oapi-codegen -config apis/v1/spec/codegen/gin.yaml apis/v1/spec/swagger.yaml
oapi-codegen --old-config-style -config apis/v1/spec/codegen/gin.yaml apis/v1/spec/swagger.yaml

.PHONY: lint-def
lint-def:
Expand Down
6 changes: 5 additions & 1 deletion apis/v1/spec/codegen/client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ output: apis/v1/zz_client_gen.go
templates: apis/v1/spec/codegen/templates
generate:
- client
package: v1
package: v1
compatibility:
old-aliasing: true
old-merge-schemas: true
old-enum-conflicts: true
7 changes: 5 additions & 2 deletions apis/v1/spec/codegen/gin.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
output: apis/v1/zz_server_gen.go
templates: apis/v1/spec/codegen/templates
generate:
- gin
package: v1
package: v1
compatibility:
old-merge-schemas: true
old-enum-conflicts: true
old-aliasing: true
174 changes: 0 additions & 174 deletions apis/v1/spec/codegen/templates/gin-wrappers.tmpl

This file was deleted.

6 changes: 5 additions & 1 deletion apis/v1/spec/codegen/types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ output: apis/v1/zz_types_gen.go
#templates: apis/v1/spec/codegen/templates
generate:
- types
package: v1
package: v1
compatibility:
old-merge-schemas: true
old-enum-conflicts: true
old-aliasing: true
2 changes: 1 addition & 1 deletion apis/v1/zz_client_gen.go

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

2 changes: 1 addition & 1 deletion apis/v1/zz_server_gen.go

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

2 changes: 1 addition & 1 deletion apis/v1/zz_types_gen.go

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

0 comments on commit 6c752a6

Please sign in to comment.