fix(jambo): Fix allOf, anyOf, null and array type parsing #33
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from jambo.parser import GenericTypeParser
|
from jambo.parser import GenericTypeParser
|
||||||
from jambo.types.type_parser_options import TypeParserOptions
|
from jambo.types.type_parser_options import TypeParserOptions
|
||||||
|
|
||||||
|
|||||||
@@ -35,17 +35,17 @@ class JSONSchema(TypedDict, total=False):
|
|||||||
|
|
|||||||
type: JSONSchemaType | list[JSONSchemaType]
|
type: JSONSchemaType | list[JSONSchemaType]
|
||||||
|
|
||||||
# Object-specific keywords
|
# Object-specific keywords
|
||||||
properties: dict[str, "JSONSchema"]
|
properties: dict[str, JSONSchema]
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
required: list[str]
|
required: list[str]
|
||||||
additionalProperties: bool | "JSONSchema"
|
additionalProperties: bool | JSONSchema
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
minProperties: int
|
minProperties: int
|
||||||
maxProperties: int
|
maxProperties: int
|
||||||
patternProperties: dict[str, "JSONSchema"]
|
patternProperties: dict[str, JSONSchema]
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
dependencies: dict[str, list[str] | "JSONSchema"]
|
dependencies: dict[str, list[str] | JSONSchema]
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
|
|
||||||
# Array-specific keywords
|
# Array-specific keywords
|
||||||
items: "JSONSchema" | list["JSONSchema"]
|
items: JSONSchema | list[JSONSchema]
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
additionalItems: bool | "JSONSchema"
|
additionalItems: bool | JSONSchema
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
minItems: int
|
minItems: int
|
||||||
maxItems: int
|
maxItems: int
|
||||||
uniqueItems: bool
|
uniqueItems: bool
|
||||||
@@ -68,15 +68,15 @@ class JSONSchema(TypedDict, total=False):
|
|||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
const: JSONType
|
const: JSONType
|
||||||
|
|
||||||
# Conditionals
|
# Conditionals
|
||||||
if_: "JSONSchema" # 'if' is a reserved word in Python
|
if_: JSONSchema # 'if' is a reserved word in Python
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
then: "JSONSchema"
|
then: JSONSchema
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
else_: "JSONSchema" # 'else' is also a reserved word
|
else_: JSONSchema # 'else' is also a reserved word
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
|
|
||||||
# Combination keywords
|
# Combination keywords
|
||||||
allOf: list["JSONSchema"]
|
allOf: list[JSONSchema]
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
anyOf: list["JSONSchema"]
|
anyOf: list[JSONSchema]
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
oneOf: list["JSONSchema"]
|
oneOf: list[JSONSchema]
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
not_: "JSONSchema" # 'not' is a reserved word
|
not_: JSONSchema # 'not' is a reserved word
|
||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
|
|
||||||
|
|
||||||
# Fix forward references
|
# Fix forward references
|
||||||
|
|||||||
|
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change? A large change with little impact, is there a necessity for this change?
|
|||||||
A large change with little impact, is there a necessity for this change?
A large change with little impact, is there a necessity for this change?