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

0 stars 0 forks source link

Merging process of optional query parameter in traits is counter-intuitive #28

Closed VasiliyLysokobylko closed 8 years ago

VasiliyLysokobylko commented 8 years ago

Due to the following wordings in the spec, located in Optional Properties subsection of Resource Types and Traits section:

To accommodate this need, a resource type or trait definition MAY append a question mark ("?") suffix to the name of any object-valued property that should not be applied if it doesn't already exist in the resource or method at the corresponding level. A property is considered object-valued if its value is of type object or of a type that has object at the base of its inheritance hierarchy. The question mark suffix indicates that the value of the property in the resource type or trait should be applied if the property name itself (without the question mark) is already defined (whether explicitly or implicitly) at the corresponding level in that resource or method.

optional query parameter defined in a trait is not merged into a method unless such parameter is already defined in the method itself.

This is not something users expect.

VasiliyLysokobylko commented 8 years ago

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

petrochenko-pavel-a commented 8 years ago

Implemented