syndesisio / syndesis-rest

The API for Syndesis - a flexible, customizable, cloud-hosted platform that provides core integration capabilities as a service. It leverages Red Hat's existing product architecture using OpenShift Online/Dedicated and Fuse Integration Services.
https://syndesis-staging.b6ff.rh-idev.openshiftapps.com/api/v1/
Apache License 2.0
6 stars 17 forks source link

Generate .d.ts files from Java model? #80

Closed gashcrumb closed 7 years ago

gashcrumb commented 7 years ago

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.

kahboom commented 7 years ago

That would be nice.

gashcrumb commented 7 years ago

@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.

KurtStam commented 7 years ago

@gashcrumb would this be of any help? https://www.npmjs.com/package/swagger-typescript-generate. It would generate the typescript api files from swagger.

gashcrumb commented 7 years ago

Absolutely that would help :-)

gashcrumb commented 7 years ago

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.

KurtStam commented 7 years ago

@gashcrumb We have a version endpoint (/api/v1/version), we can update with every change to the model.

gashcrumb commented 7 years ago

@KurtStam perfect. Lemme give that tool a go locally and see how it works.

gashcrumb commented 7 years ago

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 :-)