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

option to send all (or some) POST params in body #5

Open
Tishka17 opened this issue Mar 20, 2020 · 1 comment
Open

option to send all (or some) POST params in body #5

Tishka17 opened this issue Mar 20, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@Tishka17
Copy link
Member

It's ok not to define separate class for POST body, but to use it's arguments

@Tishka17 Tishka17 changed the title poption to send all (or some) POST params in body option to send all (or some) POST params in body Mar 20, 2020
@Tishka17 Tishka17 added the enhancement New feature or request label Mar 20, 2020
@mrmamongo
Copy link

How about to do something like that? I can write full API description if it will be approved

@dataclass
class Entity:
    ...

class EntityClient(AiohttpClient):
    @methods.get("/entities")
    async def get_all_entities(self, limit: Annotated[int, Query(default=100)], offset: Annotated[int, Query(default=0)]):
        pass

    @methods.patch("/entity/{entity_id}")
    async def update_entity(self, entity_id: Annotated[int, Query(alias="entityId")], entity: Annotated[Entity, Body(...)]):
        pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants