-
I'm just getting started looking at JSON Schema. I'm wondering about converting from JSON Schema to ROS message definitions. For this to work, each object type described in the schema would need to have a name associated with it, corresponding to the ROS message name it would be translated to. In the product catalog example, for instance, we have the dimensions of the product:
Is there a canonical way to assign a name (or generic metadata) to the type of "dimensions": {
"type": "object",
+ "typeName": "ProductDimension",
...
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There's no specific keyword for this, but the meta-data vocabulary shows the sort of annotation keyword that you want to use. If you are using draft 2020-12, you can formally define a vocabulary for your keyword(s). Alternatively, unknown keywords in 2020-12 SHOULD be treated as simple value annotations. Keywords like In draft 2019-09 and later, there is a defined format for machine-readable annotation output, and several implementations now support it. If you are on draft-07, only a few implementations support returning annotations as we had not yet defined a standard mechanism for doing so. |
Beta Was this translation helpful? Give feedback.
There's no specific keyword for this, but the meta-data vocabulary shows the sort of annotation keyword that you want to use.
If you are using draft 2020-12, you can formally define a vocabulary for your keyword(s). Alternatively, unknown keywords in 2020-12 SHOULD be treated as simple value annotations. Keywords like
title
andreadOnly
, where the keyword value is the annotation value, are simple value annotations, so this is what you want.In draft 2019-09 and later, there is a defined format for machine-readable annotation output, and several implementations now support it. If you are on draft-07, only a few implementations support returning annotations as we had not yet defined a stand…