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

Fix schema name that has end with space for redoc ui and elements ui #856

Merged
merged 3 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,4 @@ Contributors (chronological)
- Renato Damas `@codectl <https://github.com/codectl>`_
- Tayler Sokalski `@tsokalski <https://github.com/tsokalski>`_
- Sebastien Lovergne `@TheBigRoomXXL <https://github.com/TheBigRoomXXL>`_
- Luna Lovegood `@duchuyvp <https://github.com/duchuyvp>`_
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Features:
- ``MarshmallowPlugin``: Support different datetime formats
for ``marshmallow.fields.DateTime`` fields (:issue:`814`).
Thanks :user:`TheBigRoomXXL` for the suggestion and PR.
- ``MarshmallowPlugin``: Handle resolving names of schemas with spaces in the name (:pr:`856`).
Thanks :user:`duchuyvp` for the PR.

Other changes:

Expand Down
4 changes: 2 additions & 2 deletions src/apispec/ext/marshmallow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def resolver(schema: type[Schema]) -> str:
schema_cls = resolve_schema_cls(schema)
name = schema_cls.__name__
if name.endswith("Schema"):
return name[:-6] or name
return name
name = name[:-6] or name
return name.strip()


class MarshmallowPlugin(BasePlugin):
Expand Down
Loading