Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit cbad27f

Browse files
committed
Make JsonBaseModel inherit from SerializableBaseModel
1 parent 264a3e3 commit cbad27f

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

  • packages/jumpstarter-kubernetes/jumpstarter_kubernetes
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
import yaml
2-
from pydantic import BaseModel, ConfigDict
1+
from pydantic import ConfigDict
32

3+
from jumpstarter.common.pydantic import SerializableBaseModel
44

5-
class JsonBaseModel(BaseModel):
6-
"""A Pydantic BaseModel with additional Jumpstarter JSON options applied."""
7-
8-
def dump_json(self):
9-
return self.model_dump_json(indent=4, by_alias=True)
105

11-
def dump_yaml(self):
12-
return yaml.safe_dump(self.model_dump(mode="json", by_alias=True), indent=2)
6+
class JsonBaseModel(SerializableBaseModel):
7+
"""A Pydantic BaseModel with additional Jumpstarter JSON options applied."""
138

149
model_config = ConfigDict(arbitrary_types_allowed=True, populate_by_name=True)

0 commit comments

Comments
 (0)