Skip to content

fibanez6/json-schema-content-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Json Schema Content Generator

Given a Json Schema, this generates a JSON payload with random or predefined data.

Jason schema specification

Supports the json schema specification draft-06 and Draft-07 with:

Maven installation

To import this into your project, please add the following dependency:

<dependency>
    <groupId>com.fibanez</groupId>
    <artifactId>json-schema-content-generator</artifactId>
    <version>{latest-version}</version>
</dependency>

Quickstart

import org.json.JSONObject;
import com.fibanez.jsonschema.content.JsonGenerator;

// ...
InputStream in = getClass().getClassLoader().getResourceAsStream("path/to/resource/schema.json");
JSONObject jsonObject = new JsonGenerator().generate(in);

String payload = jsonObject.toString();

Libraries

  • Json-schema. This is an implementation of the JSON Schema Draft v4, Draft v6 and Draft v7 specifications. It uses the org.json API (created by Douglas Crockford) for representing JSON data.

  • Mockneat. This is an arbitrary data-generator open-source library written in Java.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages