Skip to content

Encoding of query params doesn't work when marked optional #25

@maorelias

Description

@maorelias

When marked as optional:

(def compiled
  (contextual.http/compile-request '{:query-params {:timestamp ^:optional timestamp}, :method "get"} 
  {'timestamp (contextual.core/path :ts)} 
  {} 
  {:serialize-query-params true}))

(contextual.core/invoke compiled {:ts "2021-05-28 16:22:55.000+00   00"})
=> {:method "get", :url "?timestamp=2021-05-28 16:22:55.000+00   00"}

When not marked as optional:

(def compiled
  (contextual.http/compile-request '{:query-params {:timestamp timestamp}, :method "get"} 
  {'timestamp (contextual.core/path :ts)} 
  {} 
  {:serialize-query-params true}))

(contextual.core/invoke compiled {:ts "2021-05-28 16:22:55.000+00   00"})
=> {:method "get", :url "?timestamp=2021-05-28%2016%3A22%3A55.000%2B00%20%20%2000"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions