petrochenko-pavel-a / raml-js-parser2-issues

0 stars 0 forks source link

Map declaration is not yaml 1.2 compliant #33

Closed VasiliyLysokobylko closed 8 years ago

VasiliyLysokobylko commented 8 years ago

Map declaration (https://github.com/raml-org/raml-spec/blob/raml-10/versions/raml-10/raml-10.md#map-types):

#%RAML 1.0
title: My API With Types
types:
  MapOfNumbers:
    type: object
    properties:
      []:
        type: number

The standard golang yaml parser bails with the following error:

yaml: invalid map key: []

The online yaml parser http://yaml-online-parser.appspot.com bails with the following error:

ERROR:

while constructing a mapping
found unacceptable key (list objects are unhashable)

I suggest to drop this way of declaring maps since the inline map declarations are a lot nicer anyway:

#%RAML 1.0
title: My API With Types
types:
  MapOfNumbers:
    type: number{}
VasiliyLysokobylko commented 8 years ago

https://github.com/raml-org/raml-spec/issues/286