How can you specify the specification for array elements without a struct wrapper? #2033
Unanswered
cardilloscreations
asked this question in
Q&A
Replies: 2 comments
-
|
One step closer, only slightly better, but still not satisfying. Produces This Swagger Definition: Example JSON Request Body: |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For a post body request, if the body is an array of UUID for example, and I don't want to wrap it in a struct, I can't find a way to provide the
formatspecification for the array elements or the arraymin&max.If I define it the way I want to, I can't find a way to add the additional
format,min,maxspecifications:Of course, this produces a standard Swagger definition for an array of
string, which I can hand edit to get the desired outcome, but I can't figure out a way to make swag do this properly.What I really want to specify is that the request body must be an array [1..20] of UUID strings.
Desired JSON Request Body:
If I wrap it in a struct, then I can add the additional specifications, but the resulting JSON has more layers than is needed, and for no good reason.
Swagger Definition:
Example JSON Request Body:
Beta Was this translation helpful? Give feedback.
All reactions