Generate all endpoints
BenFradet opened this issue · 7 comments
This article got me thinking:
- we might be able to scrape the documentation
- generate an open api specification out of it
- generate a client through mu
- maybe generate implementations also
🤔
or maybe bypass mu and openapi and do:
- scrape the documentation
- generate algebra
- generate implementation
- generate documentation
The documentation does not provide return types, though. It's all well and good on a dynamic typing language like javascript, but it's a big missing piece for Scala.
We might be able to infer them from a response though
If in futur, we will generate all code of github4s. I think the lib ghostbuster91/sttp-openapi-generator is interested.
sttp propose a interface with a logic similar to github4s, and sttp-openapi-generator generate idiomatic scala code.
But currently, sttp-openapi-generator can't still generate compilable code.
Generate all endpoints,this could allow reduce the time of developpement, debug, testing(if the generator is reliable). We can still after fix manually the typing issue. The idea seems great for me.
Hello,
Just wondering, ever thought of using https://github.com/github/rest-api-description as a basis? It's in beta according to the README, but as far as I can see, it's pretty much in line with the actual API,
This combined with https://github.com/guardrail-dev/sbt-guardrail could easily replace most of the codebase while extending the managed endpoints.
If there is any interest, I can start working on a PoC.
Sounds really interesting, thanks @abestel !