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
Improve Swagger Object creation #26
base: master
Are you sure you want to change the base?
Conversation
6b7aaea
to
7f0039c
Compare
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 to icyleaf#18)
7f0039c
to
2a1802d
Compare
Add management of enumeration Add support of enumeration inside creation by instance of Swagger::Object Add refs for other Swagger::Object for non primitive type in creation by instance (Related to icyleaf#18) TODO : add spec for enumeration addition
…:create_from_class
…integer case != Int32 or Int64
9e739f3
to
66adacc
Compare
… directive when instance name is retrieved from class name
66adacc
to
714c2e2
Compare
…f usage are : Json, Yaml and finally default comportment)
c3611af
to
bf66b6f
Compare
95fc12b
to
031eb8d
Compare
68a0382
to
662f4ff
Compare
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.