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

Use plain form parameters when valuing the properties of a plugin #70

Closed
subnetmarco opened this issue Mar 11, 2015 · 3 comments · Fixed by #76
Closed

Use plain form parameters when valuing the properties of a plugin #70

subnetmarco opened this issue Mar 11, 2015 · 3 comments · Fixed by #76
Assignees

Comments

@subnetmarco
Copy link
Member

Right now the plugin-related properties are sent as a JSON object in a value form field, like:

curl -d 'name=ratelimiting&api_id=ID&value={"period":"second", "limit": 10}' http://127.0.0.1:8001/plugins/

I believe that accepting those parameters in plain form values instead of encoding them into a JSON object will make the interface cleaner, so the same request becomes:

curl -d 'name=ratelimiting&api_id=ID&period=second&limit=10' http://127.0.0.1:8001/plugins/

Internally nothing will change in the way we validate the schema. Thoughts? @thibaultcha

@subnetmarco subnetmarco self-assigned this Mar 11, 2015
@subnetmarco subnetmarco added this to the 0.1.0-beta milestone Mar 11, 2015
@subnetmarco
Copy link
Member Author

The solution I decided to adopt is to set the plugins properties using the dot notation like value.limit:

curl -d 'name=ratelimiting&api_id=ID&value.period=second&value.limit=10' http://127.0.0.1:8001/plugins/

@thibaultcha
Copy link
Member

I don't like value.*. Why not what was originally planned? just period, limit... What's the reason?

@subnetmarco
Copy link
Member Author

Since schemas can support sub-schemas, and sub-schemas could support other sub-schemas (since they're just plain schemas), using just the property name is not enough and could cause name clashes. Using dot-notation fixes this problem, for example:

value.limit=10&value.extra.limit=20

gszr pushed a commit that referenced this issue Oct 26, 2021
This commit fixes a problem when tracing TCP traffic, and adds an
integration test which exercises that branch.
gszr pushed a commit that referenced this issue Oct 27, 2021
This commit fixes a problem when tracing TCP traffic, and adds an
integration test which exercises that branch.
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

Successfully merging a pull request may close this issue.

2 participants