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

0 stars 0 forks source link

Parameters for optional Resource Type properties should also be optional #67

Closed VasiliyLysokobylko closed 8 years ago

VasiliyLysokobylko commented 8 years ago

The spec currently states:

The definitions of resource types and traits MAY contain parameters, whose values MUST be specified when applying the resource type or trait ...

This means that Resource Type parameters are currently mandatory, even if they're not being used. Given a snippet like this:

# ...
resourceTypes:
  - Resource:
      get:
        description: Get one <<ResourceName>> record.
      patch?:
        description: Some info about <<TextAboutPatch>>.
# ...

In the case of a resource with no patch support, I still have to provide a blank TextAboutPatch property:

/MyThing
  type:
    Resource:
      ResourceName: MyThing
      TextAboutPatch:
  get:
    description: Override the default Resource description here.

It would be nice if the spec would allow for parameters to be optional if their corresponding resource type properties are unused for the given resource.

VasiliyLysokobylko commented 8 years ago

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

petrochenko-pavel-a commented 8 years ago

Implemented