It is often useful to annotate scalar-valued nodes, e.g. baseUri. Since annotations are applied as extra key-value pairs to nodes that accept key-value pairs already (i.e. map-valued nodes), they cannot currently be applied to scalar-valued nodes.
For the scope of this proposal, scalar-valued nodes are ones that cannot already be expressed as maps, e.g. the type node can take a scalar value or a map value, so it is not covered in this proposal.
The proposal is to allow any scalar-valued node, which is normally expressed as
baseUri: http://www.example.com/api
to alternatively be expressed as a map, with the single allowed key value:
baseUri:
value: http://www.example.com/api
and then annotations may be applied as usual, e.g.
As part of this proposal, the list of allowedTargets for annotation type declarations is expanded to include all scalar-valued nodes, such as baseUri, description, type, etc. The spec need not list them explicitly in the allowedTargets table, but may refer to a detailed table of all scalar-valued nodes.
It is often useful to annotate scalar-valued nodes, e.g.
baseUri
. Since annotations are applied as extra key-value pairs to nodes that accept key-value pairs already (i.e. map-valued nodes), they cannot currently be applied to scalar-valued nodes.For the scope of this proposal, scalar-valued nodes are ones that cannot already be expressed as maps, e.g. the
type
node can take a scalar value or a map value, so it is not covered in this proposal.The proposal is to allow any scalar-valued node, which is normally expressed as
to alternatively be expressed as a map, with the single allowed key
value
:and then annotations may be applied as usual, e.g.
As part of this proposal, the list of
allowedTargets
for annotation type declarations is expanded to include all scalar-valued nodes, such asbaseUri
,description
,type
, etc. The spec need not list them explicitly in theallowedTargets
table, but may refer to a detailed table of all scalar-valued nodes.