OCLOperators JSonToObjects

The JsonToObjects OCL operator is for converting a JSON string to a class object. The operator accommodates Model structures having more than one class with relationships.

Inorder for the JSON data to be captured, the model classes attributes have to match the JSON properties.

Example

The MDriven Designer has a feature to add attributes, associations and classes from clipboard json, this feature is very handy in ensuring your Model classes match and fit the structure of the JSON data.

Copy the JSON data

Create a class that with act as the root for the JSON structure

Copy the JSON data that needs to be saved in the Model making sure the curly braces ({}) are the root and included in the data copied.

Right Click on the root class and select Add attributes, assoc, and classes from clipboard json or xml option from options which will try to parse the copied JSON from the clipboard and create a class or classes structure that fits the JSON data.

Other Pages:

This page was edited 32 days ago on 08/19/2024. What links here