mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Clarify that reverse/format_error constraint ops are experimental
This commit is contained in:
parent
72b57a846d
commit
971684788d
2 changed files with 12 additions and 4 deletions
|
@ -91,6 +91,11 @@ int(forward, Value) ->
|
||||||
The value must be returned even if it is not converted
|
The value must be returned even if it is not converted
|
||||||
by the constraint.
|
by the constraint.
|
||||||
|
|
||||||
|
The two other operations are currently experimental. They are
|
||||||
|
meant to help implement HATEOAS type services, but proper
|
||||||
|
support for HATEOAS is not expected to be available before
|
||||||
|
Cowboy 3.0 because of Cowboy's current router's limitations.
|
||||||
|
|
||||||
The `reverse` operation does the opposite: it
|
The `reverse` operation does the opposite: it
|
||||||
takes a converted value and changes it back to what the
|
takes a converted value and changes it back to what the
|
||||||
user input would have been.
|
user input would have been.
|
||||||
|
|
|
@ -258,7 +258,8 @@ contain two parameters of name `key`.
|
||||||
|
|
||||||
The same is true when trying to use the PHP-style suffix `[]`.
|
The same is true when trying to use the PHP-style suffix `[]`.
|
||||||
When a query string is `key[]=1&key[]=2`, the list returned will
|
When a query string is `key[]=1&key[]=2`, the list returned will
|
||||||
contain two parameters of name `key[]`.
|
contain two parameters of name `key[]`. Cowboy does not require
|
||||||
|
the `[]` suffix to properly handle repeated key names.
|
||||||
|
|
||||||
When a query string is simply `key`, Cowboy will return the
|
When a query string is simply `key`, Cowboy will return the
|
||||||
list `[{<<"key">>, true}]`, using `true` to indicate that the
|
list `[{<<"key">>, true}]`, using `true` to indicate that the
|
||||||
|
@ -291,9 +292,11 @@ If no default is provided and the value is missing, the
|
||||||
query string is deemed invalid and the process will crash.
|
query string is deemed invalid and the process will crash.
|
||||||
|
|
||||||
When the query string is `key=1&key=2`, the value for `key`
|
When the query string is `key=1&key=2`, the value for `key`
|
||||||
will be the list `[1, 2]`. Parameter names do not need to
|
will be the list `[<<"1">>, <<"2">>]`. Parameter names do not
|
||||||
include the PHP-style suffix. Constraints may be used to
|
need to include the PHP-style suffix. Constraints may be used
|
||||||
ensure that only one value was passed through.
|
to ensure that only one value was given. Constraints do not
|
||||||
|
automatically look inside the list, a custom constraint must
|
||||||
|
be written if that is necessary.
|
||||||
|
|
||||||
=== Headers
|
=== Headers
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue