I want to use a global variable in RAML file:
#%RAML 1.0
title: MyTitle
myVariable: http://example.com
version: v1
baseUri: {myVariable}/{version}
but it doesn't work. Does RAML actually allow that?
No, it doesn't allow to level vars like that. However it does allow you to define baseUriParameters
like so:
#%RAML 1.0
---
baseUri: http://{myVariable}.com
baseUriParameters:
myVariable:
type: string
enum: [ us-east, us-west, emea, apac ]
default: us-east