Open kazzkiq opened 5 years ago
Below goes an example of annotations-based syntax. RFC.
It would also be possible to export Swagger JSON via Onyx CLI, I suppose.
I'd prefer being able to annotate endpoints with a DSL instead of annotations. They just look ugly to me: add a lot of noise that a clean DSL could clean up.
First of all, thanks for this awesome and fully featured project.
Some frameworks I've worked with in other languages have an extremely useful feature that is generating Swagger docs automatically, just by "reading" the code you wrote.
Dynamic and interpreted languages have some trouble generating all the contracts (including param types, etc). But from the nature of Crystal (as a compiled, statically type checked language) it should be possible to create high fidelity contracts based on the project code.
The advantages of generating docs dynamically are as clear as it can get. It would be a great feature for Onyx Framework.
There is already a shard that let's you create such docs programmatically. Perhaps that could be used as a starting point.