diff --git a/Taskfile.yaml b/Taskfile.yaml index 7d1303893..f877aff46 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -129,7 +129,7 @@ tasks: msg: Please specify generator as first cli arg (ie "task template -- go") cmds: - > - docker run --rm -w /local -v ${PWD}:/local openapitools/openapi-generator-cli:latest author + docker run --rm -w /local -v ${PWD}:/local openapitools/openapi-generator-cli:v6.4.0 author template -g {{.CLI_ARGS}} -o templates/{{.CLI_ARGS}} sdk:generate: @@ -137,13 +137,13 @@ tasks: dir: ./sdk preconditions: - sh: '[ "{{.CLI_ARGS}}" != "" ]' - msg: Please specify generator as first cli arg (ie "task generate -- go") + msg: Please specify generator as first cli arg (ie "task sdk:generate -- go") cmds: - - wget https://raw.githubusercontent.com/formancehq/ledger/{{.VERSION}}/pkg/api/controllers/swagger.yaml -O swagger.yaml + - cp ../pkg/api/controllers/swagger.yaml . - sed -i -e "s/LEDGER_VERSION/{{.VERSION}}/g" swagger.yaml - rm -rf ./sdks/{{.CLI_ARGS}}/* - > - docker run --rm -w /local -v ${PWD}:/local openapitools/openapi-generator-cli:latest generate + docker run --rm -w /local -v ${PWD}:/local openapitools/openapi-generator-cli:v6.4.0 generate -i ./swagger.yaml -g {{ (split "-" .CLI_ARGS)._0 }} -c ./configs/{{.CLI_ARGS}}.yaml diff --git a/pkg/api/controllers/swagger.yaml b/pkg/api/controllers/swagger.yaml index 6674f7f59..132869d76 100644 --- a/pkg/api/controllers/swagger.yaml +++ b/pkg/api/controllers/swagger.yaml @@ -15,13 +15,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ConfigInfoResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -43,13 +43,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/LedgerInfoResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -94,7 +94,7 @@ paths: default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -209,13 +209,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/AccountsCursorResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -248,13 +248,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/AccountResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -286,18 +286,17 @@ paths: requestBody: description: metadata content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/Metadata' required: true responses: "204": description: No Content - content: {} default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -319,13 +318,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/MappingResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -344,7 +343,7 @@ paths: example: ledger001 requestBody: content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/Mapping' required: true @@ -352,13 +351,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/MappingResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -388,7 +387,7 @@ paths: requestBody: required: true content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/Script' responses: @@ -402,7 +401,7 @@ paths: - `errorCode` and `error_code` (deprecated): contains the string code of the error - `errorMessage` and `error_message` (deprecated): contains a human-readable indication of what went wrong, for example that an account had insufficient funds, or that there was an error in the provided Numscript. content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ScriptResponse' @@ -426,13 +425,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/StatsResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -532,7 +531,7 @@ paths: default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -677,13 +676,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/TransactionsCursorResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -713,20 +712,20 @@ paths: - `postings`: suitable for simple transactions - `script`: enabling more complex transactions with Numscript content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/PostTransaction' responses: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/TransactionsResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -757,13 +756,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/TransactionResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -793,17 +792,16 @@ paths: requestBody: description: metadata content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/Metadata' responses: "204": description: No Content - content: {} default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -834,13 +832,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/TransactionResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -860,7 +858,7 @@ paths: example: ledger001 requestBody: content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/Transactions' required: true @@ -868,13 +866,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/TransactionsResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -930,13 +928,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/BalancesCursorResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -965,13 +963,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/AggregateBalancesResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' @@ -1083,13 +1081,13 @@ paths: "200": description: OK content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/LogsCursorResponse' default: description: Error content: - application/json: + application/json; charset=utf-8: schema: $ref: '#/components/schemas/ErrorResponse' diff --git a/sdk/templates/go/Taskfile.yml.mustache b/sdk/templates/go/Taskfile.yml.mustache index be8841fdc..3afbbb2a0 100644 --- a/sdk/templates/go/Taskfile.yml.mustache +++ b/sdk/templates/go/Taskfile.yml.mustache @@ -1,6 +1,10 @@ version: '3' tasks: + tidy: + cmds: + - go mod tidy + vendor: cmds: - go mod vendor @@ -22,9 +26,10 @@ tasks: test: desc: Test client code deps: + - tidy - vendor cmds: - task: start-ledger - defer: task: stop-ledger - - go test + - go test -v ./...