Hi,
The security part of the description raise an error whereas it pass the validation.
{
"openapi": "3.0.2",
"info": {
"title": "FastAPI",
"version": "0.1.0"
},
"paths": {
"/user/": {
"get": {
"tags": [
"user"
],
"summary": "Read Users",
"operationId": "read_users_user__get",
"parameters": [
{
"required": false,
"schema": {
"title": "Skip",
"type": "integer",
"default": 0
},
"name": "skip",
"in": "query"
},
{
"required": false,
"schema": {
"title": "Limit",
"type": "integer",
"default": 100
},
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"title": "Response Read Users User Get",
"type": "array",
"items": {
"$ref": "#/components/schemas/PUser"
}
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
**"security": [
{
"JWTBearer": []
},
{
"OAuth2PasswordBearer": []
}
]**
}
}
},
"components": {
"schemas": {
[...]
},
"securitySchemes": {
"JWTBearer": {
"type": "http",
"scheme": "bearer"
},
"OAuth2PasswordBearer": {
"type": "oauth2",
"flows": {
"password": {
"scopes": {},
"tokenUrl": "token"
}
}
}
}
}
}
It gives me this parse-log:
Expecting Partial<{ type: ("apiKey" | "http" | "oauth2" | "openIdConnect"), description: string, name: string, in: string, scheme: string, bearerFormat: string, flows:... at 0.paths./user/.get.1.security.0.JWTBearer but instead got: []
Expecting Partial<{ type: ("apiKey" | "http" | "oauth2" | "openIdConnect"), description: string, name: string, in: string, scheme: string, bearerFormat: string, flows:... at 0.paths./user/.get.1.security.1.OAuth2PasswordBearer but instead got: []
The error disappear when I remove the security part of the path definition.
Hi,
The security part of the description raise an error whereas it pass the validation.
{ "openapi": "3.0.2", "info": { "title": "FastAPI", "version": "0.1.0" }, "paths": { "/user/": { "get": { "tags": [ "user" ], "summary": "Read Users", "operationId": "read_users_user__get", "parameters": [ { "required": false, "schema": { "title": "Skip", "type": "integer", "default": 0 }, "name": "skip", "in": "query" }, { "required": false, "schema": { "title": "Limit", "type": "integer", "default": 100 }, "name": "limit", "in": "query" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Read Users User Get", "type": "array", "items": { "$ref": "#/components/schemas/PUser" } } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, **"security": [ { "JWTBearer": [] }, { "OAuth2PasswordBearer": [] } ]** } } }, "components": { "schemas": { [...] }, "securitySchemes": { "JWTBearer": { "type": "http", "scheme": "bearer" }, "OAuth2PasswordBearer": { "type": "oauth2", "flows": { "password": { "scopes": {}, "tokenUrl": "token" } } } } } }It gives me this parse-log:
The error disappear when I remove the security part of the path definition.