gemseo / third_party / fastjsonschema

draft07 module

class gemseo.third_party.fastjsonschema.draft07.CodeGeneratorDraft07(definition, resolver=None)[source]

Bases: gemseo.third_party.fastjsonschema.draft06.CodeGeneratorDraft06

FORMAT_REGEXS = {'date': '^(?P<year>\\d{4})-(?P<month>\\d{1,2})-(?P<day>\\d{1,2})\\Z', 'date-time': '^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:[+-][0-2]\\d:[0-5]\\d|Z)?\\Z', 'email': '^[^@]+@[^@]+\\.[^@]+\\Z', 'hostname': '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]{0,61}[A-Za-z0-9])\\Z', 'idn-email': '^[^@]+@[^@]+\\.[^@]+\\Z', 'ipv4': '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\Z', 'ipv6': '^(?:(?:[0-9A-Fa-f]{1,4}:){6}(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::(?:[0-9A-Fa-f]{1,4}:){5}(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-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\/?\\/?)[^\\s]+\\Z', 'iri-reference': '^(\\w+:(\\/?\\/?))?[^#\\\\\\s]*(#[^\\\\\\s]*)?\\Z', 'json-pointer': '^(/(([^/~])|(~[01]))*)*\\Z', 'relative-json-pointer': '^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)\\Z', 'time': '^(?P<hour>\\d{1,2}):(?P<minute>\\d{1,2})(?::(?P<second>\\d{1,2})(?:\\.(?P<microsecond>\\d{1,6}))?([zZ]|[+-]\\d\\d:\\d\\d)?)?\\Z', 'uri': '^\\w+:(\\/?\\/?)[^\\s]+\\Z', 'uri-reference': '^(\\w+:(\\/?\\/?))?[^#\\\\\\s]*(#[^\\\\\\s]*)?\\Z', 'uri-template': '^(?:(?:[^\\x00-\\x20\\"\\\'<>%\\\\^`{|}]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?)*\\})*\\Z'}
generate_content_encoding()[source]

Means decoding value when it’s encoded by base64.

{
    'contentEncoding': 'base64',
}
generate_content_media_type()[source]

Means loading value when it’s specified as JSON.

{
    'contentMediaType': 'application/json',
}
generate_if_then_else()[source]

Implementation of if-then-else.

{
    'if': {
        'exclusiveMaximum': 0,
    },
    'then': {
        'minimum': -10,
    },
    'else': {
        'multipleOf': 2,
    },
}

Valid values are any between -10 and 0 or any multiplication of two.