Skip to content

Commit

Permalink
Fix new API code gen
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Warehime committed Dec 2, 2022
1 parent 01349d8 commit a377e3f
Show file tree
Hide file tree
Showing 11 changed files with 752 additions and 462 deletions.
8 changes: 6 additions & 2 deletions daemon/algod/api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GOPATH := $(shell go env GOPATH)
GOPATH1 := $(firstword $(subst :, ,$(GOPATH)))

# `make all` or just `make` should be appropriate for dev work
all: server/v2/generated/model/types.go server/v2/generated/nonparticipating/public/routes.go server/v2/generated/nonparticipating/private/routes.go server/v2/generated/participating/public/routes.go server/v2/generated/participating/private/routes.go
all: server/v2/generated/model/types.go server/v2/generated/nonparticipating/public/routes.go server/v2/generated/nonparticipating/private/routes.go server/v2/generated/participating/public/routes.go server/v2/generated/participating/private/routes.go server/v2/generated/data/routes.go

# `make generate` should be able to replace old `generate.sh` script and be appropriate for build system use
generate: oapi-codegen all
Expand All @@ -19,6 +19,10 @@ server/v2/generated/participating/public/routes.go: algod.oas3.yml
server/v2/generated/participating/private/routes.go: algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -config ./server/v2/generated/participating/private/private_routes.yml algod.oas3.yml


server/v2/generated/data/routes.go: algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -config ./server/v2/generated/data/data_routes.yml algod.oas3.yml

server/v2/generated/model/types.go: algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -config ./server/v2/generated/model/model_types.yml algod.oas3.yml

Expand All @@ -31,6 +35,6 @@ oapi-codegen: .PHONY
../../../scripts/buildtools/install_buildtools.sh -o github.com/algorand/oapi-codegen -c github.com/algorand/oapi-codegen/cmd/oapi-codegen

clean:
rm -rf server/v2/generated/model/types.go server/v2/generated/nonparticipating/public/routes.go server/v2/generated/nonparticipating/private/routes.go server/v2/generated/participating/public/routes.go server/v2/generated/participating/private/routes.go algod.oas3.yml
rm -rf server/v2/generated/model/types.go server/v2/generated/nonparticipating/public/routes.go server/v2/generated/nonparticipating/private/routes.go server/v2/generated/participating/public/routes.go server/v2/generated/participating/private/routes.go server/v2/generated/data/routes.go algod.oas3.yml

.PHONY:
11 changes: 8 additions & 3 deletions daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,8 @@
"get": {
"description": "Get ledger deltas for a round.",
"tags": [
"private",
"data"
],
"produces": [
"application/json"
Expand Down Expand Up @@ -1859,7 +1861,8 @@
"delete": {
"description": "Unset the ledger sync round.",
"tags": [
"private"
"private",
"data"
],
"schemes": [
"http"
Expand Down Expand Up @@ -1902,7 +1905,8 @@
"get": {
"description": "Gets the minimum sync round for the ledger.",
"tags": [
"private"
"private",
"data"
],
"schemes": [
"http"
Expand Down Expand Up @@ -1947,7 +1951,8 @@
"post": {
"description": "Sets the minimum sync round on the ledger.",
"tags": [
"private"
"private",
"data"
],
"schemes": [
"http"
Expand Down
14 changes: 10 additions & 4 deletions daemon/algod/api/algod.oas3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3907,7 +3907,10 @@
}
},
"summary": "Get a LedgerStateDelta object for a given round",
"tags": []
"tags": [
"private",
"data"
]
}
},
"/v2/ledger/supply": {
Expand Down Expand Up @@ -4021,7 +4024,8 @@
},
"summary": "Removes minimum sync round restriction from the ledger.",
"tags": [
"private"
"private",
"data"
]
},
"get": {
Expand Down Expand Up @@ -4094,7 +4098,8 @@
},
"summary": "Returns the minimum sync round the ledger is keeping in cache.",
"tags": [
"private"
"private",
"data"
]
}
},
Expand Down Expand Up @@ -4165,7 +4170,8 @@
},
"summary": "Given a round, tells the ledger to keep that round in its cache.",
"tags": [
"private"
"private",
"data"
]
}
},
Expand Down
6 changes: 4 additions & 2 deletions daemon/algod/api/server/v2/generated/data/data_routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ generate:
output-options:
include-tags:
- data
- public
exclude-tags:
- private
exclude-tags:
- common
- public
- participating
- nonparticipating
type-mappings:
integer: uint64
skip-prune: true
Expand Down
381 changes: 381 additions & 0 deletions daemon/algod/api/server/v2/generated/data/routes.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ output-options:
exclude-tags:
- public
- participating
- data
- common
type-mappings:
integer: uint64
Expand Down
394 changes: 169 additions & 225 deletions daemon/algod/api/server/v2/generated/nonparticipating/private/routes.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ output-options:
- private
- common
- participating
- data
type-mappings:
integer: uint64
skip-prune: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ output-options:
exclude-tags:
- public
- nonparticipating
- data
- common
type-mappings:
integer: uint64
Expand Down
Loading

0 comments on commit a377e3f

Please sign in to comment.