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

send Nested object #271

Open
kallissin opened this issue May 11, 2022 · 1 comment
Open

send Nested object #271

kallissin opened this issue May 11, 2022 · 1 comment

Comments

@kallissin
Copy link

{
    "sender" : {
        "house": {
            "number": "111"
        }

    }
}
class Github(Consumer):
    @post("/test")
    def create(
        self,
        sender_house_number: Field("sender", "house", "number")
)
client = Github()
client.create(sender_house_number="111")

I need to send a JSON, in this example format, how to proceed?

@kallissin
Copy link
Author

solution:

class Github(Consumer):
    @json
    @post("/test")
    def create(
        self,
        sender_house_number: Field("sender", "house", "number")
)

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

No branches or pull requests

1 participant