Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST server/clients using code generation #36

Open
fxnn opened this issue Aug 10, 2018 · 0 comments
Open

REST server/clients using code generation #36

fxnn opened this issue Aug 10, 2018 · 0 comments

Comments

@fxnn
Copy link
Owner

fxnn commented Aug 10, 2018

Currently, deadbox connects frontend and backend using a REST interface. This leads to one REST server and two REST clients (one in JavaScript, the other one in Go used for testing).

Server/client code for REST endpoints is mainly boilerplate and repetitive, making changes and enhancements to the REST interface expensive. To this end, we should apply code generation.

Proposal. go-swagger is a Go implementation of Swagger / OpenAPI, a defacto standard for API documentation. The API can be specified using a YAML file, from which go-swagger can generate code. As the tool supports custom templates, we could even generate the JavaScript client from that.

Alternatives. swagger-codegen is the code generation tool from the Swagger team itself. However, it's written in Java and doesn't lend well to deadbox' toolchain.

Other REST API codegen tools are yet to evaluate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant