Skip to content

Commit d0baecd

Browse files
committed
add option to --ensure-ascii during export
1 parent e583056 commit d0baecd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ninja/management/commands/export_openapi_schema.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ def add_arguments(self, parser: CommandParser) -> None:
7272
action="store_true",
7373
help="Sort Json keys",
7474
)
75+
parser.add_argument(
76+
"--ensure-ascii",
77+
dest="ensure_ascii",
78+
default=False,
79+
action="store_true",
80+
help="ensure_ascii for JSON output",
81+
)
7582

7683
def handle(self, *args: Any, **options: Any) -> None:
7784
api = self._get_api_instance(options["api"])
@@ -81,6 +88,7 @@ def handle(self, *args: Any, **options: Any) -> None:
8188
cls=NinjaJSONEncoder,
8289
indent=options["indent"],
8390
sort_keys=options["sort_keys"],
91+
ensure_ascii=options["ensure_ascii"],
8492
)
8593

8694
if options["output"]:

0 commit comments

Comments
 (0)