raml-org / raml-tck

Test Compatibility Kit for RAML 1.0
http://raml-org.github.io/raml-tck/
8 stars 10 forks source link

Mismatched syntax in example TCK test files #139

Open arielmirra opened 3 years ago

arielmirra commented 3 years ago

Hi! I've been reviewing some files while testing and have some observations regarding these RAML 1.0 TCK files:

the RAML Spec says: "There are two ways to represent the example facet value: as an explicit description of a specific type instance and as a map that contains additional facets".

By that definition, an example object is either a literal example of the object or a map. In case it's a map, the additional facets available are described here. Being value the only facet that's not optional.

The example object in the files has the following syntax:

types:
  TestType:
    type: object
    properties:
      name: string
    example:
      strict: false
      name: 1

But taking what was declared before into account. The previous code is not a TestType object nor a valid Example map (as it's missing the value facet). In my opinion, this example can be described in two ways. As a map (the correct way as we want the strict: false property):

example:
      strict: false
      value:
        name: 1

As a TestType object (invalid as we lost the strict facet and the name is not a string):

example:
      name: 1

NOTE: this files are on i130_add_raml101_tests branch and not master.

Hope I was clear and concise. Thank you!