MCPcopy
hub / github.com/fastapi/fastapi / Path

Class Path

fastapi/params.py:137–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135
136
137class Path(Param): # type: ignore[misc]
138 in_ = ParamTypes.path
139
140 def __init__(
141 self,
142 default: Any = ...,
143 *,
144 default_factory: Callable[[], Any] | None = _Unset,
145 annotation: Any | None = None,
146 alias: str | None = None,
147 alias_priority: int | None = _Unset,
148 validation_alias: str | AliasPath | AliasChoices | None = None,
149 serialization_alias: str | None = None,
150 title: str | None = None,
151 description: str | None = None,
152 gt: float | None = None,
153 ge: float | None = None,
154 lt: float | None = None,
155 le: float | None = None,
156 min_length: int | None = None,
157 max_length: int | None = None,
158 pattern: str | None = None,
159 regex: Annotated[
160 str | None,
161 deprecated(
162 "Deprecated in FastAPI 0.100.0 and Pydantic v2, use `pattern` instead."
163 ),
164 ] = None,
165 discriminator: str | None = None,
166 strict: bool | None = _Unset,
167 multiple_of: float | None = _Unset,
168 allow_inf_nan: bool | None = _Unset,
169 max_digits: int | None = _Unset,
170 decimal_places: int | None = _Unset,
171 examples: list[Any] | None = None,
172 example: Annotated[
173 Any | None,
174 deprecated(
175 "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
176 "although still supported. Use examples instead."
177 ),
178 ] = _Unset,
179 openapi_examples: dict[str, Example] | None = None,
180 deprecated: deprecated | str | bool | None = None,
181 include_in_schema: bool = True,
182 json_schema_extra: dict[str, Any] | None = None,
183 **extra: Any,
184 ):
185 assert default is ..., "Path parameters cannot have a default value"
186 self.in_ = self.in_
187 super().__init__(
188 default=default,
189 default_factory=default_factory,
190 annotation=annotation,
191 alias=alias,
192 alias_priority=alias_priority,
193 validation_alias=validation_alias,
194 serialization_alias=serialization_alias,

Callers 15

update_itemFunction · 0.90
update_itemFunction · 0.90
read_itemsFunction · 0.90
read_itemsFunction · 0.90
read_itemsFunction · 0.90
read_itemsFunction · 0.90
read_itemsFunction · 0.90
read_itemsFunction · 0.90
read_itemsFunction · 0.90
read_itemsFunction · 0.90
read_itemsFunction · 0.90
read_itemsFunction · 0.90

Calls

no outgoing calls

Tested by 15

hidden_pathFunction · 0.72
path_examplesFunction · 0.72
test_path_reprFunction · 0.72
path_exampleFunction · 0.72
path_examplesFunction · 0.72
path_example_examplesFunction · 0.72
int_convertorFunction · 0.72
float_convertorFunction · 0.72
path_convertorFunction · 0.72
get_itemFunction · 0.72
read_required_strFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…