Skip to content

Commit

Permalink
Validate that http.code is between 100 and 999
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdowling authored and Michael Dowling committed Mar 24, 2022
1 parent 601adde commit 30300f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/source/1.0/spec/core/http-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ The ``http`` trait is a structure that supports the following members:
* - code
- ``integer``
- The HTTP status code of a successful response. Defaults to ``200`` if
not provided.
not provided. The provided value SHOULD be between 100 and 599, and
it MUST be between 100 and 999.

The following example defines an operation that uses HTTP bindings:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,8 @@ structure http {
/// The HTTP status code of a successful response.
///
/// Defaults to 200 if not provided.
code: PrimitiveInteger,
@range(min: 100, max: 999)
code: Integer,
}

/// Binds an operation input structure member to an HTTP label.
Expand Down

0 comments on commit 30300f1

Please sign in to comment.