forked from openapi-generators/openapi-python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.py
More file actions
25 lines (19 loc) · 882 Bytes
/
header.py
File metadata and controls
25 lines (19 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from pydantic import Field
from .parameter import Parameter
class Header(Parameter):
"""
The Header Object follows the structure of the [Parameter Object](#parameterObject) with the following changes:
1. `name` MUST NOT be specified, it is given in the corresponding `headers` map.
2. `in` MUST NOT be specified, it is implicitly in `header`.
3. All traits that are affected by the location MUST be applicable to a location of `header`
(for example, [`style`](#parameterStyle)).
"""
name = Field(default="", const=True)
param_in = Field(default="header", const=True, alias="in")
class Config:
allow_population_by_field_name = True
schema_extra = {
"examples": [
{"description": "The number of allowed requests in the current period", "schema": {"type": "integer"}}
]
}