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

Using empty dict as schema in output decorator causes AttributeError: 'dict' object has no attribute 'many' #11

Closed
180909 opened this issue Apr 3, 2021 · 1 comment · Fixed by #12
Assignees
Labels
bug Something isn't working

Comments

@180909
Copy link
Contributor

180909 commented Apr 3, 2021

code:
@app.delete('/pets/<int:pet_id>') @output({}, 204) def delete_pet(pet_id): if pet_id > len(pets) - 1: abort_json(404) pets.pop(pet_id) return ''
shell:
curl -v -X DELETE localhost:5000/pets/0
error:
AttributeError: 'dict' object has no attribute 'many'

@greyli greyli added the bug Something isn't working label Apr 3, 2021
@greyli greyli changed the title Method delete can't run Using empty dict as schema in output decorator causes AttributeError: 'dict' object has no attribute 'many' Apr 3, 2021
@greyli greyli self-assigned this Apr 3, 2021
@greyli greyli closed this as completed in #12 Apr 3, 2021
@greyli
Copy link
Member

greyli commented Apr 3, 2021

Hi, just fixed this in #12, you can temporarily use EmptySchema to replace the empty dict. See this commit for the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants