Skip to content

Instantly share code, notes, and snippets.

@erickpeirson
Last active April 26, 2019 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erickpeirson/e0ce63f5142eba5e1d486bafaace52c4 to your computer and use it in GitHub Desktop.
Save erickpeirson/e0ce63f5142eba5e1d486bafaace52c4 to your computer and use it in GitHub Desktop.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://foo.qwerty/some/schema#",
"title": "Foo Schema",
"type": "object",
"properties": {
"title": {
"type": "string"
},
"awesome": {
"type": "number"
}
},
"required": ["title"]
}
from jsonschema_typed.types import JSONSchema
data: JSONSchema['path/to/schema.json'] = dict(title='baz')
data['description'] = 'there is no description' # TypedDict "FooSchema" has no key 'description'
data['awesome'] = 42
data['awesome'] = None # Argument 2 has incompatible type "None"; expected "Union[int, float]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment