Skip to content

SchemaGenerator

ameci-iis edited this page Nov 27, 2024 · 1 revision

About

The mpeghuitranslator repository provides command-line program for debugging and testing purposes that can generate a random JSON corresponding to the JSON Schema files defined via its command-line arguments (e.g. the proposed JSON format for application standards defined in the json_schema/ folder of this project). The generated JSON output is syntactically conforming to the specified schema, but might not be semantically meaningful.

NOTE: The generator does not fully support the JSON Schema standard, but only the functionality required to represent the JSON Schema used in this project.

How to build

To build schema_generator set mpeghuitranslator_BUILD_BINARIES variable while configuring the project using CMake:

$ cmake -S mpeghuitranslator -B build -DCMAKE_BUILD_TYPE=Release -Dmpeghuitranslator_BUILD_BINARIES=ON

Read build instructions to learn how to configure and build the project.

If the build process is successfully finished, schema_generator can be found in the build/bin folder

Usage

schema_generator [--seed <numerical seed>] <schema files>...

Arguments

--seed <numerical seed> (optional)
The optional seed can be specified to recreate a specific generated JSON output. If not specified, the seed used internally will vary for each invocation of the tool.
<schema files>
The list of JSON Schema files specifying the schema to which the JSON output should be conformant to.

Example

schema_generator json_schema/GET/*.json
schema_generator --seed 115 json_schema/POST/*.json