In my API RAML, there is a query parameter named 'sfIds' which is an array type. I need to implement validation within the RAML to ensure that the array elements are always numeric, such as [111, 222, 333] or [111]. An array such as [ABC,111] should not pass RAML validation.
Is there a way to define "types" for this validation?
Below is a segment of my RAML code; please be aware that this is just a portion of the full RAML. It is not functioning as anticipated in my Mule flow.
#%RAML 1.0
title: My Test API
version: v1
types:
NumericArray:
type: array
items: number
/ids:
get:
queryParameters:
sfIds?:
type: NumericArray
example: [111,222]
The error that I get in the Mule flow is:
Invalid value '[111,222]' for query parameter sfIds. /0 expected type: Number, found: JSONArray"