forked from marshmallow-code/webargs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow overriding of the the arg_name convention
Rather than `{location}_args` being a hardcoded behavior, allow users to subclass and override it with a custom method. This will allow users to set alternate naming conventions in a centralized place, on their parser class. By passing the schema object to get_default_arg_name, we enable schemas which provide their own argument names to the parser. There are some ordering considerations which make it impossible to guarantee that `get_default_arg_name` gets a schema object (rather than, e.g. a callable which returns a schema). For this first implementation, I have opted to move the call after any dict-to-schema conversion happens, so that users have fewer types they need to handle.
- Loading branch information
Showing
4 changed files
with
184 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters