How to pass pre-defined set of comma separated values in a query parameter in raml?

310 views Asked by At

There are four values: a,b,c,d and the query parameter "X" can be a combination of the four values. Eg - "X": a,b,c,d or "X": a,b,c etc.

2

There are 2 answers

0
aled On

RAML doesn't has a way to validate that. You could use a regular expression in the type definition of the pattern.

0
Ryan Hoegg On

RAML query parameters with array type must allow multiple values like so: ?x=a&x=b&x=c. You can provide a string type that validates the comma delimited expression, and it will be tough to make sure you have a list of unique enumerated values.