Raml issue when importing to Anypoint studio



I am facing some problem with the raml when including data type into another data type and importing to anypoint studio. I am not able to use a combination of object and nil and array and nil.

For example:

Raml 1:
#%RAML 1.0 DataType
type: object
success: boolean
no: string|nil
type: array
items: !include details.raml

Raml 2:
#%RAML 1.0 DataType
type: object
detail1: string
detail2: string

details field in raml 1 is either an array or it can be null. If I specify this as array | nil , API manager is parsing the raml. But when importing the same into studio, it is failing. The same with the object and nil combination as well. Please suggest me some solution for this.




don’t use nil and string together


I think you should not use null or nil in raml. I think it is a bad practise


@kiran, your “Raml 1” is fully valid and if that is not working in Studio, you should probably ask MuleSoft to take a look. Not sure what’s the best way to get in touch with the Studio guys, but if you are a customer you can raise a support ticket I assume.

What you can try is to add spaces between the pipe symbol string | nil and see if that works. If that also doesn’t work, its clearly a bug.