JSON-Schema is a LabVIEW library designed to generate JSON Schema specifications from LabVIEW datatypes. It is built on top of JSONtext, extending it with additional methods for schema-specific keywords such as minimum, maximum, and more.
The library was originally developed for use by the Instrument Framework, but is useful for any LabVIEW developer needing to serialize or validate LabVIEW data structures as JSON according to a formal schema.
- Generate JSON Schemas directly from LabVIEW typedefs and variants.
- Annotate schemas with additional keywords (e.g., value constraints).
- Convert between JSON Schema and tabular representations.
- Pretty-print JSON Schemas for documentation or review.
- Developed and packaged in LabVIEW 2019.
- Install via VI Package Manager. Detailed instructions: levylabpitt.github.io
The main API VIs are located in JSON-Schema/API/. Core API methods include:
-
Create JSON Schema (Interactive).vi
Launches an interactive dialog to create a JSON Schema from a LabVIEW datatype. -
Create JSON Schema.vi
Programmatically generate a JSON Schema from a LabVIEW datatype.
-
Initialize JSON Schema.vi
Set up a new JSON Schema document.
-
Choose JSON Schema Dialect.vi
Select the JSON Schema dialect/version to use.
-
Read Typedef Description.vi / Read Typedef Description (variant).vi / Read Typedef Description (path).vi
Read and interpret the description of a typedef from a reference, variant, or file path.
-
Write Typedef Description.vi / Write Typedef Description (variant).vi / Write Typedef Description (path).vi
Write or update the description of a typedef in various forms.
-
Add Object to JSON Schema.vi
Insert a new object definition into the schema.
-
JSON Schema Pretty Print.vi
Output the JSON Schema in a human-readable format.
-
JSON Schema to Table.vi / Table to JSON Schema.vi
Convert between JSON Schema and a tabular representation for easier manipulation or review.
- see Create JSON Schema (Interactive).vi
Feedback and contributions are welcome!
Contact Patrick Irvin for more information.
