Casting with JSON schema types
In a message map, you
can use the cast function to define wildcards to a JSON data type,
or extend a JSON type that is defined with the "oneOf"
or "anyOf"
keywords.
Before you begin
- Create a message map for your JSON data. For more information, see Creating a message map.
- Ensure that you have a supported JSON schema model in the same container as your message map. For more information, see JSON schema requirements for message maps.
About this task
You can use a mapping cast with JSON schema types when
you want to use wildcards or combine complex JSON schema; for example:
- When your message model includes a wildcard. A wildcard is an
element in your schema that is defined as
xsd:any
orxsd:anyType
. The model for the Message Assembly Environment and Local Environment folders include wildcards (under the Variables folder, for example), which allow you to define data specifically for the operation of your flow. - When a JSON schema includes the
"oneOf"
or"anyOf"
keywords, to allow the flexibility to extend the content of a data type.
Procedure
To cast a wildcard or a JSON schema type that includes
the "oneOf"
or "anyOf"
keyword,
complete the following steps:
Results
The message map contains
a choice of cast items
group, including the type
that you have picked for the cast action; you can now complete mappings
to the data members of that type. For example:
What to do next
Define additional transformations between elements in the message map. For more information, see Transform types in the Graphical Data Mapping editor.