Skip to content

Commit

Permalink
Changes for Pydantic 2.10 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
mkjpryor committed Nov 29, 2024
1 parent 1cde6f0 commit b4353e4
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions kube_custom_resource/custom_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,8 @@ class CustomResource(
)

@classmethod
def __get_pydantic_json_schema__(
cls,
core_schema: CoreSchema,
handler: GetJsonSchemaHandler
) -> JsonSchemaValue:
json_schema = super().__get_pydantic_json_schema__(core_schema, handler)
# Remove the API version, kind and metadata from the schema as they are
# not required for a valid CRD
def model_json_schema(cls, *args, **kwargs):
json_schema = super().model_json_schema(*args, **kwargs)
for key in ["apiVersion", "kind", "metadata"]:
json_schema["properties"].pop(key)
json_schema["required"].remove(key)
Expand Down

0 comments on commit b4353e4

Please sign in to comment.