Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Add '@=' separator to pass JSON objects via CLI #386

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

agoconcept
Copy link

The current '=' separator enables to add key-value pairs as strings
in a JSON object to the HTTP body. But there's no way to provide
more complex JSON objects

This commit introduces a new '@=' that adds a key-value pair where
the right value is evaluated to a JSON object, allowing more complex
structures in the HTTP body.

Change-Id: I126a6c8529a6dbf9108b904b2b4d93ef60309113

Santiago Gallego added 2 commits June 14, 2018 09:32
The current '=' separator enables to add key-value pairs as strings
in a JSON object to the HTTP body. But there's no way to provide
more complex JSON objects

This commit introduces a new '@=' that adds a key-value pair where
the right value is evaluated to a JSON object, allowing more complex
structures in the HTTP body.

Change-Id: I126a6c8529a6dbf9108b904b2b4d93ef60309113
Change-Id: I94612a7de6f1673703571aa41679a3268086b6ba
hyper/cli.py Outdated

'@=' JSON data fields

name='{"name": "John", "surname": "Doe"}' list='[1, 2, 3]'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it have @= there too, like name@='{"name": "John", "surname": "Doe"}' list@='[1, 2, 3]', or am I missing something?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're completely right, I'll fix that. Thanks for noticing

Change-Id: I09cc41bead0f1ccea0d5b0c332816d2e69b2d44d
@agoconcept
Copy link
Author

Is there any additional change needed to accept the pull request? In case anything else is needed please don't hesitate to ask for it

Cheers!

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

Successfully merging this pull request may close these issues.

2 participants