From 21ea527623799a608f9baf4d81e999c6c5f5d35a Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 29 Mar 2021 22:34:24 +0200 Subject: [PATCH] api: fix invalid swagger schema Signed-off-by: Jens Langhammer --- authentik/api/schema.py | 17 ++++++----------- swagger.yaml | 30 ++++++++++++------------------ 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/authentik/api/schema.py b/authentik/api/schema.py index b75d20fbc..f60b333b8 100644 --- a/authentik/api/schema.py +++ b/authentik/api/schema.py @@ -15,17 +15,12 @@ class ErrorResponseAutoSchema(SwaggerAutoSchema): "Generic API Error", type=openapi.TYPE_OBJECT, properties={ - "errors": openapi.Schema( - type=openapi.TYPE_OBJECT, - properties={ - "detail": openapi.Schema( - type=openapi.TYPE_STRING, description="Error details" - ), - "code": openapi.Schema( - type=openapi.TYPE_STRING, description="Error code" - ), - }, - ) + "detail": openapi.Schema( + type=openapi.TYPE_STRING, description="Error details" + ), + "code": openapi.Schema( + type=openapi.TYPE_STRING, description="Error code" + ), }, required=["detail"], ) diff --git a/swagger.yaml b/swagger.yaml index 6acf37ae3..33d0dee8f 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -14467,15 +14467,12 @@ definitions: - detail type: object properties: - errors: - type: object - properties: - detail: - description: Error details - type: string - code: - description: Error code - type: string + detail: + description: Error details + type: string + code: + description: Error code + type: string ValidationError: title: Validation Error type: object @@ -14497,15 +14494,12 @@ definitions: - detail type: object properties: - errors: - type: object - properties: - detail: - description: Error details - type: string - code: - description: Error code - type: string + detail: + description: Error details + type: string + code: + description: Error code + type: string Coordinate: type: object properties: