Skip to content

Instantly share code, notes, and snippets.

@stijnmoreels
Created November 15, 2019 07:59
Show Gist options
  • Save stijnmoreels/ba31f0e5740e4d7feddf4b12fcb3dfe7 to your computer and use it in GitHub Desktop.
Save stijnmoreels/ba31f0e5740e4d7feddf4b12fcb3dfe7 to your computer and use it in GitHub Desktop.
var schema = JSchema.Parse(
@"{ 'description': 'A book',
'type': 'object',
'properties':
{ 'author': { 'type': 'string', 'minLength': 1, 'maxLength': 100 },
'isbn13': { 'type': 'string', 'minLength': 13, 'maxLength': 17 },
'pages': { 'type': 'number', 'minimum': 1, 'maximum': 1000 } } }");
schema.AllowAdditionalProperties = false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment