Overview

RAPID-ML has experimental support for user-defined extension properties. Extension properties provide information which cannot be described with standard RAPID-ML constructs. 

Some possible uses include:

  • Annotations to guide generation of example data. 
  • Mappings to external data schemas, or definitions in a metadata repository. 
  • Special handling instructions, recognized by a specific code generator. 
  • Routing or policy metadata for an external API gateway or API management system. 

Example

In this example, we have added an xsdGlobalElement property to the ProductQuantityObject resource, and to its GET response.  


In this imagined scenario:

  • Each of these contexts defines a realization of the bound ProductQuanity data structure.
  • We are working with a custom code generator that produces a specialized XML Schema. 
  • Our custom XML Schema generator creates an xsd:complexType for each realization, and a global element declaration using that complexType.
  • Our custom generator recognizes the xsdGlobalElement extension property, and uses its value to override the default name of the generated global element.

Syntax and Rules

  • Most of the important RAPID-ML model objects support extension properties.
  • The extensions keyword must be the last keyword in the containing object. 
  • Any number of extension properties may be present, indented under the extensions keyword.
  • Each extension property follows the format name : value
  • The name must be a legal Element Name, or a quoted string. Element names begin with a letter or underscore, followed by any sequence of letters, numbers and underscores.
  • The value must be a legal Element Name, a quoted string, or a multi-line string. Multi-line strings are delimited by a sequence of three single quotes.
''' this is 
    a multi-line string.
'''