Closed xaka closed 7 years ago
Actually, TypeDeclaration
was given the repeat
property for sake of compatibility with RAML 0.8 parameters, because headers
and queryParameters
are arrays of TypeDeclaration
. It's an alternative way to specify array type, but it does not override (or is overriden by) specifying array type directly. I mean,
MyType: string[]
and
MyType:
type: string[]
repeat: true
are not the same types. The last type is actually an array of string arrays. Thus, it will be incorrect to return true
as default repeat
value for all array types.
That's what I was afraid of - confusion between arrays in type system and repeat flag. We better to provide clarification over it in RAML spec. What do you think, @sichvoge?
The current spec does not say anything about the repeat
property. I think, a few words similar to those I've written above would be fine. Also think, we should restrict using the property to those cases, where TypeDeclarations are used as parameters or headers.
In future we can have a separate set of types for parameters, like we have for annotations now. But we have to deal with multiple inheritence, when creating such types set. So this task can not be implemented immediately.
repeat is actually not part of the RAML 1.0 spec anymore and has been removed.
RAML 1.0:
JSON:
I was expecting
repeat
to betrue
for array types.