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

Add uri sample with query showing it isn't captured #960

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions docs/source/1.0/spec/core/http-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,20 @@ Given an endpoint of ``https://yourhost`` and a pattern of ``/my/uri/path``:
Labels
~~~~~~

Patterns MAY contain label placeholders. :dfn:`Labels` consist of label name
characters surrounded by open and closed braces (i.e., "{label_name}" is a
label and ``label_name`` is the label name). The label name corresponds to a
top-level operation input structure member name. Every label MUST have a
corresponding input member, the input member MUST be marked as
:ref:`required-trait`, the input member MUST have the :ref:`httpLabel-trait`,
Patterns MAY contain label placeholders in the path. :dfn:`Labels` consist of
label name characters surrounded by open and closed braces (i.e.,
"{label_name}" is a label and ``label_name`` is the label name). The label
name corresponds to a top-level operation input structure member name. Every
label MUST have a corresponding input member, the input member MUST be marked
as :ref:`required-trait`, the input member MUST have the :ref:`httpLabel-trait`,
and the input member MUST reference a string, byte, short, integer, long,
float, double, bigDecimal, bigInteger, boolean, or timestamp.
float, double, bigDecimal, bigInteger, boolean, or timestamp. Labels only
capture path segments.

Labels MUST adhere to the following constraints:

#. Labels MUST NOT appear in the query string.
#. Labels MUST NOT appear in the fragment (e.g. "/foo#{bar}" is invalid).
#. Each label MUST span an entire path segment (e.g., "/{foo}/bar" is valid,
and "/{foo}bar" is invalid).

Expand All @@ -221,6 +223,12 @@ Given a pattern of ``/my/uri/{label}`` and an endpoint of ``http://yourhost``:
- Yes
- "/my/uri/" matches and "foo" is captured as ``label``. The trailing
"/" is ignored.
* - ``http://yourhost/my/uri/foo?query=bar``
- Yes
- "/my/uri/" matches and "foo" is captured as ``label``.
* - ``http://yourhost/my/uri/foo#bar``
- Yes
- "/my/uri/" matches and "foo" is captured as ``label``.
* - ``http://yourhost/my/uri/bar``
- Yes
- "/my/uri/" matches and "bar" is captured as ``label``.
Expand Down