Open MathiusD opened 2 years ago
Thanks for the PR, I reviewed the code that the current implementation only contains the base type, so if there are complex types or nested variables such an implementation would be exceptionally complicated, my suggestion is to see if Crystal implements reflection natively.
Thanks for the PR, I reviewed the code that the current implementation only contains the base type, so if there are complex types or nested variables such an implementation would be exceptionally complicated, my suggestion is to see if Crystal implements reflection natively.
Indeed, I should have put this PR in Draft. I still have to do the following:
However I don't understand how the implementation would be harder without native reflection, indeed, for schemas the open-api spec the other schema and enums are pointed by reference. (In addition reflection made here via macros allows to get all the necessary information, in my opinion)
The only point which seems to me to pose problem intuitively is the management of the Union other than SomeClass? since we could not use it in the same way.
Add creation of Swagger::Object by some object instance
(Related and insipred by #18)
Allow creation of Swagger::Object by something like that :
P.S. :
src/swagger/http/handler.cr
was modified when the code formatting was executed viacrystal tool format src && crystal tool format spec
. I have therefore committed the formatting.