Giter VIP home page Giter VIP logo

Comments (3)

sloria avatar sloria commented on May 16, 2024

Are you referring to something like this?

@app.route('/<name>')
@use_args({'name': fields.Str(location='view_args')})
def hello(args, name):
    return 'Hello {}'.format(args['name'])

I suppose this might be OK. After all, aiohttpparser and pyramidparser have the match_info and matchdict locations.

My concern is how use_kwargs would interact with app.route, since the two will inject the same keyword arguments.

from webargs.

oreza avatar oreza commented on May 16, 2024

Yes exactly,

I have not tested kwargs but wouldn't you be able to remove duplicate from kwargs before passing it the function (return func(_new_args, *_kwargs))?

If you want I can open a pull request, and you can look at it.

My personal reason for this is that I have existing API, that has lots of EP with URL segment parameters and I want to use your library but I want to keep unified way to parse and validate arguments.

Cheers,

from webargs.

sloria avatar sloria commented on May 16, 2024

I would gladly review a PR for this. Thanks in advance!

from webargs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.