This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Ellipsis", | |
"description": "Placeholder for items that are not present in a preview list, but are expected to be present in the actual list.", | |
"type": "object", | |
"properties": { | |
"...": { | |
"type": ["integer", "null"], | |
"minimum": 1 | |
}, | |
"total": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function copyStyle(oldDoc, newDoc) { | |
var links = oldDoc.getElementsByTagName('link'); | |
for (var i = 0; i < links.length; i++) { | |
var oldElement = links[i]; | |
var newElement = newDoc.createElement('link'); | |
newElement.rel = oldElement.rel; | |
newElement.href = oldElement.href; | |
newDoc.head.appendChild(newElement); | |
} | |
var styles = oldDoc.getElementsByTagName('style'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){window.addScript=function(url){document.body.appendChild(document.createElement('script')).src=url;};})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prettyJson(data) { | |
var json = JSON.stringify(data, null, "\t"); | |
function compactJson(json) { | |
try { | |
var compact = JSON.stringify(JSON.parse(json)); | |
var parts = compact.split('"'); | |
for (var i = 0; i < parts.length; i++) { | |
var part = parts[i]; | |
part = part.replace(/:/g, ': '); | |
part = part.replace(/,/g, ', '); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generic renderer for arrays | |
// Requires "render.table" and "render.generator" plugins | |
Jsonary.render.register(Jsonary.plugins.Generator({ | |
// Part of the generator plugin - this function returns a renderer based on the data/schema requirements | |
rendererForData: function (data) { | |
var FancyTableRenderer = Jsonary.plugins.FancyTableRenderer; | |
var renderer = new FancyTableRenderer({ | |
rowsPerPage: 15, | |
cellActionHtml: { | |
'remove': function (data, context, actionName) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "http://json-schema.org/schemas/GolfCourse.json", | |
"title": "Golf Course", | |
"description": "A golf course.", | |
"allOf": [{"$ref": "SportsActivityLocation.json"}], | |
"type": "object", | |
"format": "http://schema.org/GolfCourse", | |
"properties": {}, | |
"definitions": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request as request | |
import re | |
import os | |
import copy | |
import json | |
outputprefix = "schemas/" | |
outputsuffix = '.json' | |
urlprefix = "http://json-schema.org/schemas/" | |
urlsuffix = '.json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"test": ["foo", "bar"], | |
"child": { | |
"grandchild": 12345 | |
}, | |
"sibling": "sibling value", | |
"awkwardly/named~variable": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"items": { | |
"allOf": [ | |
{...} | |
] | |
}, | |
"definitions": { | |
"myFragment": {"$ref": "#/items/allOf/0"} | |
} | |
} |