Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add options for how to flatten/encode form and query parameters #433

Merged
merged 3 commits into from
Feb 13, 2018

Conversation

dakrone
Copy link
Owner

@dakrone dakrone commented Feb 13, 2018

This adds the following new parameters:

  • :ignore-nested-query-string :: Do not handle nested query parameters specially, treat them as
    the exact text they come in as. Defaults to false.
  • :flatten-nested-form-params :: Flatten nested (map within a map) :form-params before encoding
    it as the body. Defaults to false, meaning form params are encoded only
    x-www-form-urlencoded.
  • :flatten-nested-keys :: An advanced way of specifying which keys having nested maps should be
    flattened. A middleware function checks the previous two options
    (:ignore-nested-query-string and :flatten-nested-form-params) and modifies this to be the
    list that will be flattened.

Resolves #427

This adds the following new parameters:

- `:ignore-nested-query-string` :: Do not handle nested query parameters specially, treat them as
     the exact text they come in as. Defaults to *false*.
- `:flatten-nested-form-params` :: Flatten nested (map within a map) `:form-params` before encoding
     it as the body. Defaults to *false*, meaning form params are encoded only
     `x-www-form-urlencoded`.
- `:flatten-nested-keys` :: An advanced way of specifying which keys having nested maps should be
     flattened. A middleware function checks the previous two options
     (`:ignore-nested-query-string` and `:flatten-nested-form-params`) and modifies this to be the
     list that will be flattened.

Resolves #427
@dakrone dakrone merged commit 47a7762 into master Feb 13, 2018
dakrone added a commit that referenced this pull request Feb 13, 2018
* Add options for how to flatten/encode form and query parameters

This adds the following new parameters:

- `:ignore-nested-query-string` :: Do not handle nested query parameters specially, treat them as
     the exact text they come in as. Defaults to *false*.
- `:flatten-nested-form-params` :: Flatten nested (map within a map) `:form-params` before encoding
     it as the body. Defaults to *false*, meaning form params are encoded only
     `x-www-form-urlencoded`.
- `:flatten-nested-keys` :: An advanced way of specifying which keys having nested maps should be
     flattened. A middleware function checks the previous two options
     (`:ignore-nested-query-string` and `:flatten-nested-form-params`) and modifies this to be the
     list that will be flattened.

Resolves #427

* Add a test for the new middleware

* Throw IllegalArgumentException when multiple options are specified
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant