Auto Generated Schema for Serialized Data Objects

:leaves: LEAF version:

:jigsaw: LEAF component(s):

Issue/Question: Does LEAF provide a way to auto generate a schema for a serialized Data Object based on the data object metadata? I think this could be useful in many situations including validating Data Objects provided by external non LEAF services or for integrating LEAF services with other tools such as Drools or NiFi.

Hi Graham,

Just to make sure I am understanding your question, would you mind clarifying what you mean by schema and DataObject Metadata? Are you referring to BeanMetadata? LEAF currently doesn’t provide a way to auto generate a BeanMetadata for a serialized DataObject. Other teams have used our JsonToDataObjectDeserializer class to deserialize JSON from a non-LEAF service into a DataObject, but a BeanMetadata for the expected values is needed in order to store and do validation for the DataObject.

Let me know if you have more questions,
Beth

LEAF can serialize DataObjects into JSON (I think it can do XML as well if I recall correctly) for communication and storage. I want a JSON Schema and/or XSD Schema generated from the beanmetadata which could be used to validate JSON/XML data to ensure it complies with the beanmetadata.

We don’t offer support for generating a JSON schema to validate, but in Java we do provide the DataObjectValidationService which can validate DataObjects (deserialized from JSON) are valid according to the BeanMetadata requirements.