|
|
|
|
|
by treve
2050 days ago
|
|
I understand more than a few do this and love this. To me the schema & design should test the implementation. If you generate the schema based on the implementation, your schema is basically implicit. I dont think by doing it this way you really get the benefit of the premise of this article. You get some other benefits, like API documenation and perhaps client code generation and that's perfectly ok if that's all you need. However, if you believe in the idea of schema-driven, design-first api development, don't do this. |
|
This is what I do. I have typescript functions that generate openapi responses.
I do generate the schémas from sequelize models, blending in descriptions and enums where appropriate.
https://southpole.stoplight.io/docs/calculate/docs/CSV%20imp...