Closed gashcrumb closed 7 years ago
That would be nice.
@jimmidyson This is going to get critical as we start passing data between the API and the frontend, it's a bit laborious to make up the model based on the swagger.
@gashcrumb would this be of any help? https://www.npmjs.com/package/swagger-typescript-generate. It would generate the typescript api files from swagger.
Absolutely that would help :-)
What I'd love to see is if the model changes some kind of automation where we can generate the typescript and have a PR opened for the ipaas-ui repo, that way it's really clear there's been model changes that we may have to deal with.
@gashcrumb We have a version endpoint (/api/v1/version), we can update with every change to the model.
@KurtStam perfect. Lemme give that tool a go locally and see how it works.
Bummer that one didn't seem to work, but found this one -> https://github.com/wcandillon/swagger-js-codegen
Which generates all the types nicely along with client code. Just working on tweaking code generation templates, think I might get rid of the client code actually as it only appears to generate one class with methods that match the operationId
, which isn't terribly helpful :-)
It'd be really awesome if we had a generate that generated typescript interface files for the model, currently we're duplicating it sort of in files like this but it'll be difficult to maintain parity long-term.