-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add a Swagger support #9
Comments
Hi,
Maybe if you have some time left you could already start and take a look into that issue and find first solutions for some of the points. |
Started to compile some documentation on how the internals work (far from complete): https://github.com/pheymann/typedapi/blob/master/docs/UnderTheHood_Client.md |
Hi, |
Hi, |
Hi @wookievx , I also agree that it would make more sense to create some abstract representation of your documentation and to implement different backends/engines to render this representation to Swagger or whatever format. I think building up some ADT during compilation makes sense: sealed trait Documentation
final case class Endpoint(method: Method, path: Seq[Path], ...) extends Documentation
sealed trait Path extends Documentation
final case class PathElement(name: String) extends Path
final case class Segment(name: String, tpe: String) extends Path
... What we can do derive this ADT during compilation as we do with the What we end up with is an abstract representation - as you said - which we then can render. I think one of the bigger tasks will be to derive a e.g. Swagger representation for the Do you have time to look into this a bit more and to create some initial WIP PR or even final PR for this task? |
Recently i picked up some resolve to tackle this issue after discovering that this library provide almost full coverage of OpenApi specification. Unfortunately it is not separate from the of the "rest-framework" which is redundant from typeadapi perspective and brings a few binaries with it (unfortunately it cannot be reduced even by extracting open-api specific part away). On the other hand current approach to responding with different response codes is not applicable to automatic documentation generation. It would require api to evolve in a way that encodes status codes and respective responses at least to some degree on the type-level. |
Hi @wookievx , I will take a closer look soon and will try to help you with the status code issue. |
Hello, val MyApi = := :> Get[Json, A :+: B :+: C :+: CNil] specific backend may decide what status code is associated with the given type and the same approach can be used by documenting module (we might introduce typeclass |
It would be great if it will be possible to generate a swagger json file for the server side API.
The text was updated successfully, but these errors were encountered: