Open slobo opened 5 years ago
[[[egg on face]]] We were using old release, seems there is better behaviour in latest release. will experiment with that a bit first
I can see the very same behaviour on current master.
I assume the issue is in https://github.com/khrt/Raisin/blob/master/lib/Raisin/Plugin/Swagger.pm#L286 where everything which is not HashRef
is ignored.
It would be great if we could still use group
syntax to describe the
hashref that's in arrayref.
On Sun., Jul. 28, 2019, 09:18 Artur Khabibullin, notifications@github.com wrote:
I assume the issue is in https://github.com/khrt/Raisin/blob/master/lib/Raisin/Plugin/Swagger.pm#L286 where everything which is not HashRef is ignored.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/khrt/Raisin/issues/71?email_source=notifications&email_token=AABI6XAZZHYI7H6ZQSBESHTQBXBGZA5CNFSM4IHHE3R2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD27BYNY#issuecomment-515775543, or mute the thread https://github.com/notifications/unsubscribe-auth/AABI6XCDA3GXZGZDAR5UBD3QBXBGZANCNFSM4IHHE3RQ .
I've kinda fixed it. The fix is that if type of a parameter is ArrayRef[.+]
the plugin generates parameters of type array
with items any-type. See https://swagger.io/docs/specification/data-models/data-types/
Not sure if it's what you want, but at least the spec is valid now.
Released to CPAN to anyway, even if it doesn't solve your issue.
Thanks for such quick action, this helps! I'll keep the ticket open in hopes we can get more extensive ArrayRef[HashRef]
support such that any deep nested JSON structure can be described eventually
We would like an endpoint to to take a list of objects as an input, ex:
Naive approach, where we don't validate each object in list would be like this
This generates following bit in swagger:
But there is no definition of
Entries-MD5Hash
indefinitions
section in swagger, which makes the swagger.json out of spec.Ideally, we would be able to define the structure of the HashRef too as part of the definition.
Any suggestions how to deal with this?
Thanks!