mirror of https://github.com/tiangolo/fastapi.git
added sequence params to test cases
This commit is contained in:
parent
fb8a2d5fb2
commit
758590f66c
|
|
@ -1,5 +1,5 @@
|
|||
import http
|
||||
from typing import FrozenSet, Mapping, Optional
|
||||
from typing import FrozenSet, List, Mapping, Optional
|
||||
|
||||
from fastapi import FastAPI, Path, Query
|
||||
|
||||
|
|
@ -194,6 +194,11 @@ def get_query_params(queries: Mapping[str, int] = Query({})):
|
|||
return f"foo bar {queries}"
|
||||
|
||||
|
||||
@app.get("/query/sequence-params")
|
||||
def get_sequence_query_params(queries: Mapping[str, List[int]] = Query({})):
|
||||
return f"foo bar {queries}"
|
||||
|
||||
|
||||
@app.get("/enum-status-code", status_code=http.HTTPStatus.CREATED)
|
||||
def get_enum_status_code():
|
||||
return "foo bar"
|
||||
|
|
|
|||
|
|
@ -1113,6 +1113,44 @@ openapi_schema = {
|
|||
},
|
||||
}
|
||||
},
|
||||
"/query/sequence-params": {
|
||||
"get": {
|
||||
"operationId": "get_sequence_query_params_query_sequence_params_get",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "queries",
|
||||
"required": False,
|
||||
"schema": {
|
||||
"additionalProperties": {
|
||||
"items": {"type": "integer"},
|
||||
"type": "array",
|
||||
},
|
||||
"default": {},
|
||||
"title": "Queries",
|
||||
"type": "object",
|
||||
},
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {"application/json": {"schema": {}}},
|
||||
"description": "Successful " "Response",
|
||||
},
|
||||
"422": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/HTTPValidationError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Validation " "Error",
|
||||
},
|
||||
},
|
||||
"summary": "Get Sequence Query " "Params",
|
||||
}
|
||||
},
|
||||
"/enum-status-code": {
|
||||
"get": {
|
||||
"responses": {
|
||||
|
|
|
|||
Loading…
Reference in New Issue