问题
In my api, I have a type who contains a map of uuid->Drive
. I have used a Map type[1] to define that :
type: object
properties:
drives:
required: false
type: object
properties:
[(a-zA-Z0-9-)*] :
type: Drive
That work but I would like to be more precise on the pattern. However I can't manage to have it working.
["(a-zA-Z0-9){8}-(a-zA-Z0-9){4}-(a-zA-Z0-9){4}-(a-zA-Z0-9){4}-(a-zA-Z0-9){12}"]:
Don't seems to be used as regular expression.[(a-zA-Z0-9){8}-(a-zA-Z0-9){4}-(a-zA-Z0-9){4}-(a-zA-Z0-9){4}-(a-zA-Z0-9){12}]:
Say Missed comma between flow collection entries
How can I use a complex expession in a Map type with RAML 1.0 ?
(I'm using API Workbench)
[1] http://docs.raml.org/specs/1.0/#raml-10-spec-map-types
回答1:
Using patternProperties
instead of the alternative syntax I don't have any errors in my RAML. However it seems that, API Workbench validates nothing.
来源:https://stackoverflow.com/questions/35563875/raml-1-0-map-types-complex-regular-expression