Skip to content

Commit

Permalink
Fix resolver function with schema has spaces in name
Browse files Browse the repository at this point in the history
  • Loading branch information
duchuyvp authored and khiemnv committed Sep 12, 2023
1 parent fd21f3b commit 1ea911a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,4 @@ Contributors (chronological)
- Mounier Florian `@paradoxxxzero <https://github.com/paradoxxxzero>`_
- Renato Damas `@codectl <https://github.com/codectl>`_
- Tayler Sokalski `@tsokalski <https://github.com/tsokalski>`_
- Luna Lovegood `@duchuyvp <https://github.com/duchuyvp>`_
5 changes: 3 additions & 2 deletions src/apispec/ext/marshmallow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ 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()
return name.strip()


class MarshmallowPlugin(BasePlugin):
Expand Down

0 comments on commit 1ea911a

Please sign in to comment.