Giter Club home page Giter Club logo

Comments (6)

provinzkraut avatar provinzkraut commented on July 20, 2024 3

Yeah. I think we should do this for all injected things.

E.g.

async def handler(
  param: Query[str], 
  request_body: Body[list[str]], 
  header: Header[int],
):
 ...

IMO this belongs to the DI redesign and is something I'd definitely want to address as part of that.

from litestar.

cofin avatar cofin commented on July 20, 2024

I've guessing this should also apply to other reserved parameters such as state and query?

from litestar.

peterschutt avatar peterschutt commented on July 20, 2024

Agree - it would be great to be more flexible in this respect!

from litestar.

tuukkamustonen avatar tuukkamustonen commented on July 20, 2024

Just want to highlight how nice it would be to split Parameter into more specific types, ie. Body, Query, Header, Cookie, Path(?). Current mechanism of having to thing: Annotated[int, Parameter(header="thing")] vs thing: Annotated[int, Header()]) feels a bit bloated.

Also discussed in #3223 (comment) & #3223 (comment). FYI.

from litestar.

provinzkraut avatar provinzkraut commented on July 20, 2024

@tuukkamustonen That's already in the current proposal, see #3053 (comment)

from litestar.

tuukkamustonen avatar tuukkamustonen commented on July 20, 2024

Yeah, just wanted to highlight how nice it would be to have those types. The topic of the ticket is "allow ... parameter to have an arbitrary name" (and not add Query, Body, etc convenience wrappers for shorter field name syntax...) after all.

But yeah, good that you have it scoped like that 👍🏻

from litestar.

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.