JSFiddle - React, Tailwind, and code Playground
by newgene
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/ajv/6.12.5/ajv.min.js"></script>
JavaScript
var ajv = new Ajv({
allErrors: true,
jsonPointers: true,
$data: true
});
// Ajv options allErrors and jsonPointers are required
//require('ajv-errors')(ajv /*, {singleError: true} */ );
var schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"name": {
"description": "Descriptive name of the dataset",
"type": "string"
},
"description": {
"description": "Longer description of what is contained in the dataset",
"type": "string"
},
"author": {
"description": "Name of the author or organization that created the dataset. Note: schema.org/author and schema.org/organization have additional fields that can provide more information about the author/organization, if desired.",
"anyOf": [
{
"$ref": "#/definitions/person"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/person"
}
},
{
"$ref": "#/definitions/organization"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/organization"
}
}
]
},
"license": {
"description": "A license document that applies to this content, typically indicated by a URL",
"type": "string"
},
"cost": {
"description": "Specify the cost to obtain the dataset, \"Free\", \"Subscription\" or others",
"type": "string"
},
"url": {
"description": "The main URL about the dataset",
"type": "string",
"format": "uri"
},
"identifier": {
"description": "identifier for the dataset in a shared repository (GEO, Zenodo, figshare, etc)",
"type": "string"
},
"contain_geo_codes": {
"description": "Does the dataset contains GEO codes (e.g. zip codes, addresses, or other geo coordinates (latitude, longitude)?",
"type": "boolean"
},
"contain_phi": {
...