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

Update schema name resolver to remove unnecessary "List" suffix #21

Merged
merged 1 commit into from
May 24, 2021

Conversation

greyli
Copy link
Contributor

@greyli greyli commented Apr 5, 2021

In my opinion, the List suffix for the OpenAPI schema name is unnecessary.

Assuming we have a User schema. In OpenAPI, an array of User objects will be represented with:

type: array
items:
  $ref: '#/components/schemas/UserList'

Thus, the UserList schema is actually just a User schema. There won't be a conflict between User and User(many=True).

Besides, there is only one schema called UserList generated in spec (not a User schema plus a UserList schema), the user may be confused with this behavior.

@miguelgrinberg
Copy link
Owner

Yeah, it seems the name does not really matter as apispec will merge the list and non-list versions into the same schema. Thanks.

@miguelgrinberg miguelgrinberg merged commit fee7425 into miguelgrinberg:master May 24, 2021
@greyli greyli deleted the fix-schema-resolver branch May 24, 2021 12:52
This pull request was closed.
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

Successfully merging this pull request may close these issues.

2 participants