You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not at the moment, at least not in a way that would cause REST Docs to enforce that each element in the array is of a particular scalar type.
What is your intended way to document something like this?
Right now, I'd just document it in the description. Something like, "An array of Strings that … ".
wilkinsona
changed the title
How to document array element types?
Allow the type of an array's scalar elements to be documented and enforced
Apr 24, 2018
Many thanks for the very fast response. Your proposed workaround is exactly what we are doing now but having first-level support for this would be awesome. Many thanks for considering it. I might have a stab at it myself and provide a PR if I find the time. 😀
Not sure if this is the right place to ask this question but maybe it directly translates to a feature request. Let our payload be as follows:
We can easily document the
data
property with the following code:We know that every element is of type string and it is guaranteed that each element will be of type string; none of the following approaches work:
The text was updated successfully, but these errors were encountered: