0

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?

max
  • 612
  • 7
  • 26

1 Answers1

2

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
Ryan Carter
  • 11,441
  • 2
  • 20
  • 27