Skip to content

Commit

Permalink
chore: add make targets for getting schema and generating
Browse files Browse the repository at this point in the history
  • Loading branch information
ikadix committed Mar 19, 2024
1 parent f522c3d commit 4efa020
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 10 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ check-generate:
( diff -rN "$(CURDIR)" "$(CHKDIR)" && rm -rf "$(CHKDIR)" ) || \
( rm -rf "$(CHKDIR)" && exit 1 )

.PHONY: generate-next
generate-next:
( cd ./next && ./generate.sh )

#
# Katapult API Schemas
#
Expand All @@ -133,6 +137,10 @@ check-schemas:
( diff -rN "$(CURDIR)/schemas" "$(CHKDIR)/schemas" && rm -rf "$(CHKDIR)" ) \
|| ( rm -rf "$(CHKDIR)" && exit 1 )

.PHONY: retrieve-openapi-schema
retrieve-openapi-schema:
wget -O next/katapult-openapi.json https://api.katapult.io/core/v1/schema/openapi.json

#
# Coverage
#
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Documentation:



# Next Client
# Experimental "next" Client
A more feature complete client is being generated in the `next` package.
The aim for this client is to be generated from an openapi spec and should
offer access to everything that is documented / exposed in our API documentation.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/augurysys/timestamp v0.3.2
github.com/dave/jennifer v1.6.0
github.com/deepmap/oapi-codegen/v2 v2.0.0
github.com/deepmap/oapi-codegen/v2 v2.1.0
github.com/hashicorp/go-hclog v1.4.0
github.com/jimeh/go-golden v0.1.0
github.com/jimeh/rands v0.3.0
Expand Down
7 changes: 3 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ github.com/dave/jennifer v1.6.0/go.mod h1:AxTG893FiZKqxy3FP1kL80VMshSMuz2G+Egvsz
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
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/deepmap/oapi-codegen/v2 v2.0.0 h1:3TS7w3r+XnjKFXcbFbc16pTWzfTy0OLPkCsutEHjWDA=
github.com/deepmap/oapi-codegen/v2 v2.0.0/go.mod h1:7zR+ZL3WzLeCkr2k8oWTxEa0v8y/F25ane0l6A5UjLA=
github.com/deepmap/oapi-codegen/v2 v2.1.0 h1:I/NMVhJCtuvL9x+S2QzZKpSjGi33oDZwPRdemvOZWyQ=
github.com/deepmap/oapi-codegen/v2 v2.1.0/go.mod h1:R1wL226vc5VmCNJUvMyYr3hJMm5reyv25j952zAVXZ8=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
Expand Down Expand Up @@ -54,7 +54,6 @@ github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HK
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro=
github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down Expand Up @@ -106,8 +105,8 @@ golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=
golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
10 changes: 8 additions & 2 deletions next/client.go

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

26 changes: 24 additions & 2 deletions next/katapult-openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"servers": [
{
"url": "http://katapult-api.localhost/core/v1"
"url": "https://api.katapult.io/core/v1"
}
],
"paths": {
Expand Down Expand Up @@ -10133,6 +10133,10 @@
"type": "integer",
"nullable": true
},
"use_dedicated_cpus": {
"type": "boolean",
"nullable": true
},
"gpu_type": {
"allOf": [
{
Expand Down Expand Up @@ -10241,6 +10245,9 @@
}
],
"nullable": true
},
"use_dedicated_cpus": {
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -10606,6 +10613,10 @@
"type": "integer",
"nullable": true
},
"use_dedicated_cpus": {
"type": "boolean",
"nullable": true
},
"gpu_type": {
"allOf": [
{
Expand Down Expand Up @@ -10730,6 +10741,10 @@
"type": "integer",
"nullable": true
},
"use_dedicated_cpus": {
"type": "boolean",
"nullable": true
},
"gpu_type": {
"allOf": [
{
Expand Down Expand Up @@ -10992,6 +11007,9 @@
},
"memory_in_gb": {
"type": "integer"
},
"use_dedicated_cpus": {
"type": "boolean"
}
},
"required": [
Expand Down Expand Up @@ -11927,6 +11945,10 @@
"type": "integer",
"nullable": true
},
"use_dedicated_cpus": {
"type": "boolean",
"nullable": true
},
"gpu_type": {
"allOf": [
{
Expand Down Expand Up @@ -16413,4 +16435,4 @@
]
}
]
}
}

0 comments on commit 4efa020

Please sign in to comment.