diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-05-10 19:56:41 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-05-10 19:56:41 -0700 |
commit | 71c6b0a4418511a6c0046742512066fc27e51b21 (patch) | |
tree | fd6e6ac97df646f2d72a83fe5148eb40f38a9cd2 /golang/README.md | |
parent | 353de263272d41f6d7c1becb481f787966a1aa4c (diff) | |
download | fatcat-71c6b0a4418511a6c0046742512066fc27e51b21.tar.gz fatcat-71c6b0a4418511a6c0046742512066fc27e51b21.zip |
cleanup openapi schema
Diffstat (limited to 'golang/README.md')
-rw-r--r-- | golang/README.md | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/golang/README.md b/golang/README.md index 667b9a2e..9bcfdfb5 100644 --- a/golang/README.md +++ b/golang/README.md @@ -42,6 +42,8 @@ In early development, we'll make at least the following simplifications: ## OpenAPI Code Generation + cat fatcat-openapi2.yml | python3 -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' > fatcat-openapi2.json + Install the go-swagger tool: go get -u github.com/go-swagger/go-swagger/cmd/swagger @@ -49,8 +51,15 @@ Install the go-swagger tool: "Simple" server: - swagger generate server -A Fatcat -f fatcat-openapi2.yml + swagger generate server -A Fatcat -f fatcat-openapi2.json "Custom" server: - swagger generate server -A fatcat -f ./fatcat-openapi2.yml --exclude-main -t gen + swagger generate server -A fatcat -f ./fatcat-openapi2.json --exclude-main -t gen + +## Future + +Could refactor the API side to use gRPC and grpc-gateway instead of swagger +(which would result in a compatible REST JSON interface). For faster bots and +import, and lower latency between webface and backend. + |