raml-org / raml-spec

RAML Specification
http://raml.org
3.87k stars 858 forks source link

Add ability to have constants #759

Open rspremulli-sf opened 3 years ago

rspremulli-sf commented 3 years ago

Use case:

I have a discriminated type, and certain properties, such as the discriminator value itself, may only accept a single valid value. There is a need to pass the value to identify the type, but there is only one allowed value. Ideally, we could have a constant facet that simply says, "this is the value you must pass"

Current workaround:

required value with an enum that has only one value in it.