api: fix invalid swagger schema

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-03-29 22:34:24 +02:00
parent 36c34e05f8
commit 21ea527623
2 changed files with 18 additions and 29 deletions

View File

@ -15,17 +15,12 @@ class ErrorResponseAutoSchema(SwaggerAutoSchema):
"Generic API Error", "Generic API Error",
type=openapi.TYPE_OBJECT, type=openapi.TYPE_OBJECT,
properties={ properties={
"errors": openapi.Schema( "detail": openapi.Schema(
type=openapi.TYPE_OBJECT, type=openapi.TYPE_STRING, description="Error details"
properties={ ),
"detail": openapi.Schema( "code": openapi.Schema(
type=openapi.TYPE_STRING, description="Error details" type=openapi.TYPE_STRING, description="Error code"
), ),
"code": openapi.Schema(
type=openapi.TYPE_STRING, description="Error code"
),
},
)
}, },
required=["detail"], required=["detail"],
) )

View File

@ -14467,15 +14467,12 @@ definitions:
- detail - detail
type: object type: object
properties: properties:
errors: detail:
type: object description: Error details
properties: type: string
detail: code:
description: Error details description: Error code
type: string type: string
code:
description: Error code
type: string
ValidationError: ValidationError:
title: Validation Error title: Validation Error
type: object type: object
@ -14497,15 +14494,12 @@ definitions:
- detail - detail
type: object type: object
properties: properties:
errors: detail:
type: object description: Error details
properties: type: string
detail: code:
description: Error details description: Error code
type: string type: string
code:
description: Error code
type: string
Coordinate: Coordinate:
type: object type: object
properties: properties: