Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
vtopc committed Dec 18, 2024
1 parent 62f5b12 commit a47c2ec
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.idea/
cmd/mailgun/mailgun
/.env

/internal/types/redocly-mailgun/
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

PACKAGE := github.com/mailgun/mailgun-go
GOPATH=$(shell go env GOPATH)
TYPES_PATH=./internal/types

NILAWAY = $(GOPATH)/bin/nilaway
$(NILAWAY):
Expand Down Expand Up @@ -36,3 +37,15 @@ $(GOLINT):
.PHONY: lint
lint: $(GOLINT)
$(GOLINT) run

# go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest
#
# mailgun/api-reference/openapi-final.yaml fails due to interface{} fields
# cd $(TYPES_PATH)/redocly-mailgun/docs/mailgun/api-reference/ && sed -i '' 's/openapi: 3.1.0/openapi: 3.0.0/' openapi-final.yaml
# oapi-codegen -config $(TYPES_PATH)/mailgun_cfg.yaml $(TYPES_PATH)/redocly-mailgun/docs/mailgun/api-reference/openapi-final.yaml
.PHONY: gen-models
gen-models:
cd $(TYPES_PATH) && git clone --depth 1 [email protected]:mailgun/redocly-mailgun.git
cd $(TYPES_PATH)/redocly-mailgun/docs/inboxready/api-reference/ && sed -i '' 's/openapi: 3.1.0/openapi: 3.0.0/' openapi-final.yaml
oapi-codegen -config $(TYPES_PATH)/inboxready_cfg.yaml $(TYPES_PATH)/redocly-mailgun/docs/inboxready/api-reference/openapi-final.yaml
rm -rf $(TYPES_PATH)/redocly-mailgun
6 changes: 6 additions & 0 deletions internal/types/inboxready_cfg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json
package: types
output: ./internal/types/inboxready.gen.go
generate:
models: true
client: false
6 changes: 6 additions & 0 deletions internal/types/mailgun_cfg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json
package: types
output: ./internal/types/mailgun.gen.go
generate:
models: true
client: false

0 comments on commit a47c2ec

Please sign in to comment.