Skip to content

Commit 21961b7

Browse files
authored
Allow const to be Any type (#248)
Trying to create a schema that uses `const` with a non-string value crashes Per the specification: > The value of this keyword MAY be of any type, including null. https://json-schema.org/draft/2020-12/json-schema-validation#section-6.1.3
1 parent 3e9b220 commit 21961b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flask_openapi3/models/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ class Schema(BaseModel):
5454
externalDocs: ExternalDocumentation | None = None
5555
example: Any | None = None
5656
deprecated: bool | None = None
57-
const: str | None = None
57+
const: Any | None = None
5858

5959
model_config = {"populate_by_name": True}

0 commit comments

Comments
 (0)