Replies: 2 comments
-
This seems entirely reasonable to me, not least because of the reference you cite (which also appears to have some background in json-schema-org/json-schema-spec#628 and friends) but also because the comment is associated with the field, rather than its type. Hence if we didn't support this I can't see how fields with this referenced type wouldn't end up with the same comment (i.e. the description attached to @eadlam please can you raise an issue for this? We can firm things up there. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@myitcv I created a link issue. We already use CUE to declare our order form schema for APIs, but now as we build human facing GUI, we need human friendly descriptions for each field, and want CUE to drive that too. |
Beta Was this translation helpful? Give feedback.
-
Consider this cue spec:
All of the properties have comments, and when we export OpenAPI specs most of these comments are added to the description field of the property. But, properties whose values are a
$ref
in OpenAPI (xRange, yRange) do not include the description:However, the OpenAPI 3.0 spec does not forbid a description as a sibling of a
$ref
, it only says that sibling properties will be ignored. See bottom of this page: https://swagger.io/docs/specification/using-ref/I'm using these OpenAPI specs to generate code and documentation, and it would be very helpful to preserve comments in a description field sibling to the
$ref
. I don't think it would harm anything to have it there.Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions