Skip to content

Commit

Permalink
Fix #130 in a backward-compatible way (#219)
Browse files Browse the repository at this point in the history
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}'
  • Loading branch information
ymmt2005 committed Jul 9, 2023
1 parent f0a7d52 commit 452f1fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/openapi2jsonschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def construct_value(load, node):
filename = filename_format.format(
kind=y["spec"]["names"]["kind"],
group=y["spec"]["group"].split(".")[0],
fullgroup=y["spec"]["group"],
version=version["name"],
).lower() + ".json"

Expand All @@ -164,6 +165,7 @@ def construct_value(load, node):
filename = filename_format.format(
kind=y["spec"]["names"]["kind"],
group=y["spec"]["group"].split(".")[0],
fullgroup=y["spec"]["group"],
version=version["name"],
).lower() + ".json"

Expand All @@ -173,6 +175,7 @@ def construct_value(load, node):
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"

Expand Down

0 comments on commit 452f1fe

Please sign in to comment.