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

Commit fc69069

Browse files
committed
Support additional dump modes
1 parent fdb02c6 commit fc69069

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

packages/jumpstarter/jumpstarter/common/pydantic.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ def dump(self, mode: OutputType = None):
1919
return self.dump_json()
2020
case OutputMode.YAML:
2121
return self.dump_yaml()
22-
case _:
22+
case OutputMode.NAME:
23+
return self.dump_name()
24+
case OutputMode.PATH:
25+
return self.dump_path()
26+
case None | _:
2327
raise NotImplementedError("unimplemented output mode: {}".format(mode))
2428

25-
def dump_json(self):
29+
def dump_json(self) -> str:
2630
return self.model_dump_json(indent=4, by_alias=True) + "\n"
2731

28-
def dump_yaml(self):
32+
def dump_yaml(self) -> str:
2933
return yaml.safe_dump(self.model_dump(mode="json", by_alias=True), indent=2)

0 commit comments

Comments
 (0)