typesense / typesense-java

Java client for Typesense
https://typesense.org/docs/latest/api/
Apache License 2.0
60 stars 29 forks source link

Update models to 0.23.0, Generate model files as part of build process #27

Closed stepheno closed 11 months ago

stepheno commented 1 year ago

Change Summary

Replace the manual model generation step with a gradle build step which uses swagger codegen to generate model files. Add version 0.23.0 of the swagger spec to this repo.

To generate a new version of the api models, download the most recent swagger spec from https://github.com/typesense/typesense-api-spec and place in the root of this repo.

Moved from jaxrs-cxf-client to java/jersey2. CXF was an unused dependency, so choosing a generator library which includes the jackson mapper used in the api call class

PR Checklist

kishorenc commented 1 year ago

@stepheno

Thank you, this looks great. Is there a way to pull the yml spec from the primary repository here though: https://github.com/typesense/typesense-api-spec

Because that's the source of truth, and it would be good to avoid a copy + paste when changes are done to the source.

stepheno commented 1 year ago

@kishorenc

I had planned to use the swagger spec from that repo, but i did not see a way to specify a remote source in the swagger codegen plugin.

I could try adding a gradle task that pulls the latest spec as part of the codegen task if you'd like.

kishorenc commented 1 year ago

Yes, If we can pull it via gradle task, that would be great!

shinusuresh commented 11 months ago

This looks like a nice feature. If @stepheno is no longer working on this, I can offer help to get the remaining task completed and push