Created
July 21, 2016 15:28
-
-
Save tejovanthn/c93b2e8953889e87f06e015a057ab7a9 to your computer and use it in GitHub Desktop.
Lost in dicts
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
def append(data): | |
if not data.get('type',None): | |
return {'type':'object', 'properties':data} | |
else: | |
return data |
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
{ | |
"meal": { | |
"type": "array", | |
"title": "Meal", | |
"minItems": 1, | |
"items": { | |
"course": { | |
"type": "array", | |
"title": "Course", | |
"items": { | |
"minof": { | |
"type": "string", | |
"title": "Min number" | |
}, | |
"maxof": { | |
"type": "string", | |
"title": "Max number" | |
}, | |
"options": { | |
"type": "string", | |
"title": "Options", | |
"format": "text" | |
} | |
} | |
} | |
} | |
} | |
} |
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
{ | |
"type": "object", | |
"properties": { | |
"meal": { | |
"type": "array", | |
"title": "Meal", | |
"minItems": 1, | |
"items": { | |
"type": "object", | |
"properties": { | |
"course": { | |
"type": "array", | |
"title": "Course", | |
"items": { | |
"type": "object", | |
"properties": { | |
"minof": { | |
"type": "string", | |
"title": "Min number" | |
}, | |
"maxof": { | |
"type": "string", | |
"title": "Max number" | |
}, | |
"options": { | |
"type": "string", | |
"title": "Options", | |
"format": "text" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment