At the moment, there is an OpenAPISchemaValidator which extends Draft4Validator. This validator should be extended so it supports the full schemaObject definition.
[ ] default — Fill in the default value, and validate the default against the schema.
[ ] discriminator — I shouldn't be creating issues on a saturday morning… :coffee:
[ ] readOnly — Should eventually be used to validate a response, but should not be accepted in the request.
[ ] xml — Not needed for schema validation.
[ ] externalDocs — Not needed for schema validation.
[ ] example — Not needed for schema validation.
Incoming primitive types / formats should be converted to Python types according to the schema.
Common Name
type
format
Python type
Comments
integer
integer
int32
int
signed 32 bits
long
integer
int64
int
signed 64 bits
float
number
float
float
double
number
double
decimal.Decimal
string
string
str
byte
string
byte
base64 encoded characters
binary
string
binary
any sequence of octets
boolean
boolean
bool
date
string
date
datetime.date
As defined by full-date - RFC3339
dateTime
string
date-time
datetime.datetime
As defined by date-time - RFC3339
password
string
password
str
Used to hint UIs the input needs to be obscured.
byte / binary
Keep as-is or decode? Keep as str or convert to bytes? Or BytesIO?
date / datetime
Convert to a timezone aware object or convert to UTC?
http://swagger.io/specification/#schemaObject
At the moment, there is an
OpenAPISchemaValidator
which extendsDraft4Validator
. This validator should be extended so it supports the full schemaObject definition.default
— Fill in the default value, and validate the default against the schema.discriminator
— I shouldn't be creating issues on a saturday morning… :coffee:readOnly
— Should eventually be used to validate a response, but should not be accepted in the request.xml
— Not needed for schema validation.externalDocs
— Not needed for schema validation.example
— Not needed for schema validation.Incoming primitive types / formats should be converted to Python types according to the schema.
byte / binary
Keep as-is or decode? Keep as
str
or convert tobytes
? OrBytesIO
?date / datetime
Convert to a timezone aware object or convert to UTC?