def _get_schema(cls): if hasattr(cls, 'params_schema'): return cls.params_schema return [ convert_schema(i) for i in exclude(cls.run.__annotations__, 'return').values() ]
def __named_json_schema__(cls): return cls.__name__, { 'type': 'object', 'additionalProperties': cls._additional_properties, 'properties': {k: convert_schema(v) for k, v in cls.schema_fields()}, }
def to_json_schema(cls): sch = convert_schema(cls.inner) if cls.min_value is not None: sch['minimum'] = cls.min_value if cls.max_value is not None: sch['maximum'] = cls.max_value return sch
def to_json_schema(cls): return { 'type': 'object', 'additionalProperties': False, 'properties': {k: convert_schema(v) for k, v in cls.schema_fields()}, }
def _get_schema(cls): if hasattr(cls, 'params_schema'): return cls.params_schema return [convert_schema(i) for i in exclude(cls.run.__annotations__, 'return').values()]
def wrapped(fn): fn.status_schema = convert_schema(sch) return fn
def wrapped(fn): fn.params_schema = convert_schema(sch) return fn