forked from alecthomas/jsonschema
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to ignore struct types in schema
Replaces alecthomas#32, thanks to alecthomas#35 fixing the other part of it anyway.
- Loading branch information
Showing
4 changed files
with
137 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{ | ||
"$schema": "http:\/\/json-schema.org\/draft-04\/schema#", | ||
"$ref": "#\/definitions\/TestUser", | ||
"definitions": { | ||
"GrandfatherType": { | ||
"properties": {}, | ||
"additionalProperties": true, | ||
"type": "object" | ||
}, | ||
"TestUser": { | ||
"required": [ | ||
"some_base_property", | ||
"some_base_property_yaml", | ||
"grand", | ||
"SomeUntaggedBaseProperty", | ||
"id", | ||
"name", | ||
"TestFlag", | ||
"age", | ||
"email" | ||
], | ||
"properties": { | ||
"SomeUntaggedBaseProperty": { | ||
"type": "boolean" | ||
}, | ||
"TestFlag": { | ||
"type": "boolean" | ||
}, | ||
"age": { | ||
"maximum": 120, | ||
"exclusiveMaximum": true, | ||
"minimum": 18, | ||
"exclusiveMinimum": true, | ||
"type": "integer" | ||
}, | ||
"birth_date": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"email": { | ||
"type": "string", | ||
"format": "email" | ||
}, | ||
"feeling": { | ||
"oneOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"type": "integer" | ||
} | ||
] | ||
}, | ||
"friends": { | ||
"items": { | ||
"type": "integer" | ||
}, | ||
"type": "array", | ||
"description": "list of IDs, omitted when empty" | ||
}, | ||
"grand": { | ||
"$schema": "http:\/\/json-schema.org\/draft-04\/schema#", | ||
"$ref": "#\/definitions\/GrandfatherType" | ||
}, | ||
"id": { | ||
"type": "integer" | ||
}, | ||
"name": { | ||
"maxLength": 20, | ||
"minLength": 1, | ||
"pattern": ".*", | ||
"type": "string", | ||
"title": "the name", | ||
"description": "this is a property", | ||
"default": "alex", | ||
"examples": [ | ||
"joe", | ||
"lucy" | ||
] | ||
}, | ||
"network_address": { | ||
"type": "string", | ||
"format": "ipv4" | ||
}, | ||
"photo": { | ||
"type": "string", | ||
"media": { | ||
"binaryEncoding": "base64" | ||
} | ||
}, | ||
"some_base_property": { | ||
"type": "integer" | ||
}, | ||
"some_base_property_yaml": { | ||
"type": "integer" | ||
}, | ||
"tags": { | ||
"patternProperties": { | ||
".*": { | ||
"additionalProperties": true, | ||
"type": "object" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"website": { | ||
"type": "string", | ||
"format": "uri" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"type": "object" | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module github.com/alecthomas/jsonschema | ||
module github.com/rawlingsj/jsonschema |
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
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