mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
Change the type of bindings from a list to a map
Maps make more sense because the keys are unique.
This commit is contained in:
parent
91ae70b06c
commit
9255cdf1d7
6 changed files with 25 additions and 33 deletions
|
@ -8,10 +8,10 @@ cowboy_req:bindings - Access all values bound from the route
|
|||
|
||||
[source,erlang]
|
||||
----
|
||||
bindings(Req :: cowboy_req:req()) -> [{Name :: atom(), any()}]
|
||||
bindings(Req :: cowboy_req:req()) -> cowboy_router:bindings()
|
||||
----
|
||||
|
||||
Return all bindings as a list of key/value pairs.
|
||||
Return a map containing all bindings.
|
||||
|
||||
== Arguments
|
||||
|
||||
|
@ -27,7 +27,7 @@ automatically converting numbers to integer).
|
|||
|
||||
== Changelog
|
||||
|
||||
* *2.0*: Only the values are returned, it is no longer wrapped in a tuple.
|
||||
* *2.0*: Only the values are returned, they are no longer wrapped in a tuple.
|
||||
* *1.0*: Function introduced.
|
||||
|
||||
== Examples
|
||||
|
|
|
@ -33,7 +33,7 @@ a 404 response otherwise.
|
|||
|
||||
[source,erlang]
|
||||
----
|
||||
bindings() :: [{atom(), binary()}]
|
||||
bindings() :: #{atom() => any()}
|
||||
----
|
||||
|
||||
Bindings found during routing.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue