raml-org / raml-spec

RAML Specification
http://raml.org
3.87k stars 857 forks source link

Clarify how to infer/determine the default type for ALL built-in types #710

Closed jstoiko closed 3 years ago

jstoiko commented 5 years ago

In the Determine Default Types section, a number of rules are enumerated to help infer a type without having to specify the type facet.

The first rule mentions how setting a facet that is unique to a given type removes the need to specify the type facet. The issue is that it only specifies properties as inferring type: object. This was clearly an oversight when writing the Spec as there are other types that have facets unique to them such as fileTypes for type: file and items for type: array.

Proposed clarification:

to:

If, and only if, a type declaration contains a facet that is unique to that type, then the default type is that type

  • adapt subsequent rules referring to the first one
  • make it clear that the type: object/properties in that first rule is only an example
postatum commented 4 years ago

It looks like it's impossible to determine default type for boolean, date and nil as they either don't have unique facets or have no facets at all.

jstoiko commented 4 years ago

You're right. Doesn't seem to contradict the proposed clarification above though, does it?

postatum commented 4 years ago

You're right. Doesn't seem to contradict the proposed clarification above though, does it?

It doesn't.