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": "array",
- "items": {"type": "string"},
- "uniqueItems": true
- },
- "model": {
- "type": "array",
- "items": {"type": "string"}
- },
- "horse_power": {
- "type": "integer",
- "minimum": 1,
- "action": {
- "type": "array",
- "items": {"enum": ["gt", "gte", "lt", "lte", "eq", "in"]}
- },
- },
- "if": {
- "properties": {"horse_power": {"action": {"const": "in"}}},
- },
- "then": {
- "properties": {
- "interval": {
- "type": "array",
- "items": {"type": "integer"},
- "minItems": 2,
- "maxItems": 2
- }
- }
- },
- "color": {"type": "string"},
- "year_of_issue": {
- "type": "integer",
- "minimum": 1800,
- "action": {"enum": ["gt", "gte", "lt", "lte", "eq"]}
- },
- "transmission_type": {"enum": ["manual", "automatic", "cvt"]},
- "body_type": {"type": "string"},
- },
- }
Advertisement
Add Comment
Please, Sign In to add comment