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

0 stars 0 forks source link

Clarify that 'discriminator' and 'discriminatorValue' can only be defined for global type definitions #21

Closed VasiliyLysokobylko closed 8 years ago

VasiliyLysokobylko commented 8 years ago

Due to its nature, RC2 should explicitly state that defining discriminator and discriminatorValue should only be available for global type definitions and not for any types that are declared inline.

# valid
types:
   Device:
     type: Phone | Notebook
     discriminator: kind
# invalid
application/json: 
   type: Phone | Notebook
   discriminator: kind
VasiliyLysokobylko commented 8 years ago

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