-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* nesting default values inline * mostly working, need to fix 'nil' on missing values in default object * small tweaks * fixed bug with default object * updated tests to include more test cases * fixed bug where default object was being assumed to have values that only exist within in-line field declarations * Renaming def to defaults * Reordering inputs to match other hydrate helper functions * add comment for removenullkeys --------- Co-authored-by: chrisghill <[email protected]>
- Loading branch information
1 parent
0efbcc7
commit 47f89a8
Showing
4 changed files
with
344 additions
and
140 deletions.
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
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,97 +1,202 @@ | ||
{ | ||
"required": [ | ||
"nodescription", | ||
"testbool", | ||
"testemptybool", | ||
"testlist", | ||
"testmap", | ||
"testnumber", | ||
"testobject", | ||
"testset", | ||
"teststring" | ||
], | ||
"properties": { | ||
"teststring": { | ||
"title": "teststring", | ||
"type": "string", | ||
"description": "An example string variable", | ||
"default": "string value" | ||
}, | ||
"testnumber": { | ||
"title": "testnumber", | ||
"type": "number", | ||
"description": "An example number variable", | ||
"default": 20 | ||
}, | ||
"testbool": { | ||
"title": "testbool", | ||
"type": "boolean", | ||
"description": "An example bool variable", | ||
"default": false | ||
}, | ||
"testemptybool": { | ||
"title": "testemptybool", | ||
"type": "boolean", | ||
"description": "An example empty bool variable", | ||
"default": false | ||
}, | ||
"testobject": { | ||
"title": "testobject", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "name", | ||
"type": "string" | ||
}, | ||
"address": { | ||
"title": "address", | ||
"type": "string" | ||
}, | ||
"age": { | ||
"title": "age", | ||
"type": "number" | ||
} | ||
}, | ||
"required": [ | ||
"name" | ||
], | ||
"description": "An example object variable", | ||
"default": { | ||
"name": "Bob", | ||
"address": "123 Bob St." | ||
} | ||
}, | ||
"testlist": { | ||
"title": "testlist", | ||
"type": "array", | ||
"description": "An example list variable", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"testset": { | ||
"title": "testset", | ||
"type": "array", | ||
"uniqueItems": true, | ||
"description": "An example set variable", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"testmap": { | ||
"title": "testmap", | ||
"type": "object", | ||
"description": "An example map variable", | ||
"propertyNames": { | ||
"pattern": "^.*$" | ||
}, | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
}, | ||
"nodescription": { | ||
"title": "nodescription", | ||
"type": "string" | ||
} | ||
} | ||
"required": [ | ||
"nodescription", | ||
"testbool", | ||
"testemptybool", | ||
"testlist", | ||
"testmap", | ||
"testnestedobject", | ||
"testnumber", | ||
"testobject", | ||
"testset", | ||
"teststring" | ||
], | ||
"properties": { | ||
"teststring": { | ||
"title": "teststring", | ||
"type": "string", | ||
"description": "An example string variable", | ||
"default": "string value" | ||
}, | ||
"testnumber": { | ||
"title": "testnumber", | ||
"type": "number", | ||
"description": "An example number variable", | ||
"default": 20 | ||
}, | ||
"testbool": { | ||
"title": "testbool", | ||
"type": "boolean", | ||
"description": "An example bool variable", | ||
"default": false | ||
}, | ||
"testemptybool": { | ||
"title": "testemptybool", | ||
"type": "boolean", | ||
"description": "An example empty bool variable", | ||
"default": false | ||
}, | ||
"testobject": { | ||
"title": "testobject", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "name", | ||
"type": "string" | ||
}, | ||
"address": { | ||
"title": "address", | ||
"type": "string" | ||
}, | ||
"age": { | ||
"title": "age", | ||
"type": "number" | ||
} | ||
}, | ||
"required": [ | ||
"name" | ||
], | ||
"description": "An example object variable", | ||
"default": { | ||
"name": "Bob", | ||
"address": "123 Bob St." | ||
} | ||
}, | ||
"testnestedobject": { | ||
"title": "testnestedobject", | ||
"description": "An example nested object variable", | ||
"type": "object", | ||
"required": [ | ||
"name" | ||
], | ||
"properties": { | ||
"name": { | ||
"title": "name", | ||
"type": "string" | ||
}, | ||
"address": { | ||
"title": "address", | ||
"type": "string", | ||
"default": "123 Bob St." | ||
}, | ||
"age": { | ||
"title": "age", | ||
"type": "number", | ||
"default": 30 | ||
}, | ||
"dead": { | ||
"title": "dead", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"phones": { | ||
"title": "phones", | ||
"type": "object", | ||
"default": { | ||
"home": "987-654-3210" | ||
}, | ||
"required": [ | ||
"home" | ||
], | ||
"properties": { | ||
"home": { | ||
"title": "home", | ||
"type": "string" | ||
}, | ||
"work": { | ||
"title": "work", | ||
"type": "string", | ||
"default": "123-456-7891" | ||
} | ||
} | ||
}, | ||
"children": { | ||
"title": "children", | ||
"type": "array", | ||
"default": [ | ||
{ | ||
"name": "bob", | ||
"occupation": { | ||
"company": "none", | ||
"experience": 2, | ||
"manager": true | ||
} | ||
} | ||
], | ||
"items": { | ||
"type": "object", | ||
"required": [ | ||
"name" | ||
], | ||
"properties": { | ||
"name": { | ||
"title": "name", | ||
"type": "string" | ||
}, | ||
"occupation": { | ||
"title": "occupation", | ||
"type": "object", | ||
"default": { | ||
"company": "Massdriver", | ||
"experience": 1, | ||
"manager": false | ||
}, | ||
"required": [ | ||
"company" | ||
], | ||
"properties": { | ||
"company": { | ||
"title": "company", | ||
"type": "string" | ||
}, | ||
"experience": { | ||
"title": "experience", | ||
"type": "number", | ||
"default": 0 | ||
}, | ||
"manager": { | ||
"title": "manager", | ||
"type": "boolean", | ||
"default": false | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"testlist": { | ||
"title": "testlist", | ||
"type": "array", | ||
"description": "An example list variable", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"testset": { | ||
"title": "testset", | ||
"type": "array", | ||
"uniqueItems": true, | ||
"description": "An example set variable", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"testmap": { | ||
"title": "testmap", | ||
"type": "object", | ||
"description": "An example map variable", | ||
"propertyNames": { | ||
"pattern": "^.*$" | ||
}, | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
}, | ||
"nodescription": { | ||
"title": "nodescription", | ||
"type": "string" | ||
} | ||
} | ||
} |
Oops, something went wrong.