raml-spec icon indicating copy to clipboard operation
raml-spec copied to clipboard

Describing an object property with reserved word

Open DimitrK opened this issue 7 years ago • 1 comments

I am trying to define the schema for the following object

   #examples/errorDetail.json
    [{
      "path": "username",
      "value": "user1"
    }]

As you can see there is a property named value which collides with the word being reserved in raml.

Here is the schema:

    #schemas/errorDetail.raml
    type: array
    required: false
    items:
      type: object
      properties:
        path:
          type: string
          required: false
        value:
          type: string

I include this schema in my api.raml but when I am trying to describe this property raml linter in atom I get the following error: Error in the included file: Required property 'value' is missing

Once I remove the value property from the schema everything works fine.

Any ideas on how to declare such raml reserved words as object properties without having the linter complaining?

DimitrK avatar Mar 13 '18 22:03 DimitrK

@DimitrK: I see nothing wrong with your RAML snippet, it passes validation on my end. Which linter do you use? is it up-to-date?

jstoiko avatar Mar 28 '18 16:03 jstoiko