From 452f1fe1db8d6a0735b43e550610fe033761410f Mon Sep 17 00:00:00 2001 From: "Yamamoto, Hirotaka" Date: Sun, 9 Jul 2023 19:51:30 +0900 Subject: [PATCH] Fix #130 in a backward-compatible way (#219) This is an alternative way to fix #130. Instead of changing the `group` variable content, this commit adds a new variable `fullgroup` that does not split the group components. With this, users can specify the filename format like: FILENAME_FORMAT='{fullgroup}-{version}-{kind}' --- scripts/openapi2jsonschema.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/openapi2jsonschema.py b/scripts/openapi2jsonschema.py index f8cf844..9d981b4 100755 --- a/scripts/openapi2jsonschema.py +++ b/scripts/openapi2jsonschema.py @@ -155,6 +155,7 @@ if __name__ == "__main__": filename = filename_format.format( kind=y["spec"]["names"]["kind"], group=y["spec"]["group"].split(".")[0], + fullgroup=y["spec"]["group"], version=version["name"], ).lower() + ".json" @@ -164,6 +165,7 @@ if __name__ == "__main__": filename = filename_format.format( kind=y["spec"]["names"]["kind"], group=y["spec"]["group"].split(".")[0], + fullgroup=y["spec"]["group"], version=version["name"], ).lower() + ".json" @@ -173,6 +175,7 @@ if __name__ == "__main__": filename = filename_format.format( kind=y["spec"]["names"]["kind"], group=y["spec"]["group"].split(".")[0], + fullgroup=y["spec"]["group"], version=y["spec"]["version"], ).lower() + ".json"