You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To accommodate this need, a resource type definition MAY append a question mark ("?") suffix to the name of any method to declare the method as optional, resulting in the following behavior:
OH, maybe it's a bit confusing first; but that general headline only talks about optional nodes in RAML. That means, when we say
A trailing question mark, for example description?, indicates an optional property.
It really mean, whenever you see (inside the specification document) a node with a question mark; it is an optional node. For example:
#%RAML 1.0
title: A
description: Test
#%RAML 1.0
title: A
Both examples are valid, since description is an optional node. On the other hand, title is a required node and leaving it out is not valid.
When you said "In RAML 0.8, only methods w/i resource types were optional, denoted with a question mark (e.g. get?).", you referred to a mechanism that is available in a resource type definition. Marking a method "optional" does nothing else than having you to declare it explicitly on the resource to apply it. For example:
In RAML 0.8, only methods w/i resource types were optional, denoted with a question mark (e.g.
get?
.In RAML 1.0, a lot more can be optional. We should figure out a sane approach to parsing and reflecting how a named attribute is optional.
The text was updated successfully, but these errors were encountered: