Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import enum
- class EnumSchemas(enum.Enum):
- CHARACTERISTIC_SCHEMA = {
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "brand": {"type": "string"},
- "model": {"type": "string"},
- "horse_power": {
- "type": "object",
- "properties": {
- "value": {
- "type": "integer",
- "minimum": 1
- },
- "actions": {
- "default": "in",
- "enum": ["gt", "gte", "lt", "lte", "eq", "in"]
- },
- },
- "if": {
- "properties": {"actions": {"const": "in"}},
- },
- "then": {
- "properties": {
- "interval": {
- "type": "array",
- "items": {"type": "integer"},
- "minItems": 2,
- "maxItems": 2
- }
- }
- },
- "required": ["value", "actions"]
- },
- "color": {
- "type": "array",
- "items": {"type": "string"},
- "uniqueItems": true
- },
- "year_of_issue": {
- "type": "integer",
- "minimum": 1800,
- "action": {"enum": ["gt", "gte", "lt", "lte", "eq"]}
- },
- "transmission_type": {"enum": ["manual", "automatic", "cvt"]},
- "body_type": {"enum": [
- "sedan",
- "coupe",
- "hatchback",
- "minivan",
- "pickup"
- ]},
- },
- }
Advertisement
Add Comment
Please, Sign In to add comment