How to use variable in raml for response code?


Currently In raml we have to hard-code the response code as below:
description: O.K.
schema: xyz
example: abc

But my requirement is to use a variable in raml for my response code. Instead of 200 response code, I have declared a variable as below:

description: O.K.
schema: <>
example: <>

This variable can be read from any properties file or so.
Does raml support this? And how to implement this in raml


Hi @gargmohit, can you please elaborate more on this? As far as I know there is no way to declare a variable and load it from a property file, but maybe if I understand your underlying problem - we could find a suitable solution.


Even I feel the same .
RAML is an API specification and I am not sure if a variable can be populated in RAML from a .properties file and as far I know RAML doesn’t support this.


I actually know people that used maven plugins, templatized the RAML document and substitute values during the compile time based on the active spring profile. something like that.