-
Notifications
You must be signed in to change notification settings - Fork 74
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 dict as Schema #423
base: main
Are you sure you want to change the base?
Conversation
0deedfd
to
a17b409
Compare
Codecov ReportBase: 99.87% // Head: 99.87% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #423 +/- ##
=======================================
Coverage 99.87% 99.87%
=======================================
Files 13 13
Lines 823 829 +6
Branches 180 182 +2
=======================================
+ Hits 822 828 +6
Partials 1 1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
a17b409
to
f75770e
Compare
Thanks. This PR proves it is feasible with little modifications. I'm not so happy with the test in Also it looks from your comment like this function accepts dictionaries already, while it was not explicitly intended to. Perhaps something I overlooked that worked by luck. I shall look into this and perhaps rework this to make things explicit. I's a pity we do the |
Yes, I find this in f5b7212 when I try to figure out why Personally, I suggest changing this usages. It's so confusing. |
Yes. There's something a bit fishy in this. Perhaps I should review it, especially now that I'd rather sort this out before going forward with this PR trying to find workarounds for a design issue that ought to be addressed first. |
I looked into this tonight. Passing the schema doc as Then any |
Back to this. Since passing doc as dict is neither really documented (apart from the docstring type) nor tested, I'm open to dropping the case. If anyone complains we can always figure out a way. I've been trying to implement this on my own taking inspiration in this PR and I realized that generated schemas have a default name which yields warnings in apispec. See #180 (comment). Let's discuss this issue there. |
Sometimes it's not necessary to define a schema class for each API.
This PR support
@blp.arguments({'arg': ma.fields.Str()})
and@blp.response(200, {'arg': ma.fields.Str()})
close #180 #238