Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multibyte language for export_openapi_schema #1389

Open
lion-man44 opened this issue Jan 11, 2025 · 0 comments
Open

Support multibyte language for export_openapi_schema #1389

lion-man44 opened this issue Jan 11, 2025 · 0 comments

Comments

@lion-man44
Copy link

I'd like to use export_openai_schema command in Japanese way.
But the command can't export it.

Because of this.

result = json.dumps(
schema,
cls=NinjaJSONEncoder,
indent=options["indent"],
sort_keys=options["sort_keys"],
)

        result = json.dumps(
            schema,
            cls=NinjaJSONEncoder,
            indent=options["indent"],
            sort_keys=options["sort_keys"],
        )
# sample code
>>> data
{'id': 1, 'name': 'ほげ☺️'}
>>> json.dumps(data)
'{"id": 1, "name": "\\u307b\\u3052\\u263a\\ufe0f"}'
>>> json.dumps(data, ensure_ascii=False)
'{"id": 1, "name": "ほげ☺️"}'

I think it's much better if ninja can support multibyte language, since ninja is a Japanese word :)
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant