Data validation, serialization, deserialization & form rendering. ๐ข
Repo encode/typesystem, read from GitHub 5 h ago. encode has not joined Take My Repo.
ref according to OAS 3: #/components/schemas/Version 0.3.0 changes how Schema validators are created. In this release validators are created as instances of Schema.
import typesystem artist_schema = typesystem.Schema( fields={ "name": typesystem.String(max_length=100) } ) definitions = typesystem.Definitions() definitions["Artist"] = artist_schema album_schema = typesystem.Schema( fields={ "title": typesystem.String(max_length=100), "release_date": typesystem.Date(), "artist": typesystem.Reference("Artist", definitions=definitions) } )
The output of validation is also a dict, so there's no need to serialize validated data.
album, error = album_schema.validate_or_error(data)
UUID field