diff --git a/Fyreplace/Resources/openapi.yaml b/Fyreplace/Resources/openapi.yaml index f79a9b2..43c8a9e 100644 --- a/Fyreplace/Resources/openapi.yaml +++ b/Fyreplace/Resources/openapi.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: Fyreplace API - version: v0.8.0 + version: v0.9.0 paths: /emails: get: @@ -28,6 +28,12 @@ paths: type: array items: $ref: "#/components/schemas/Email" + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "401": description: Not Authorized "403": @@ -59,6 +65,12 @@ paths: application/json: schema: $ref: "#/components/schemas/Email" + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "409": description: Conflict content: @@ -90,6 +102,10 @@ paths: description: OK "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "404": description: Not Found "401": @@ -213,6 +229,10 @@ paths: $ref: "#/components/schemas/Post" "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "401": description: Not Authorized "403": @@ -263,6 +283,10 @@ paths: type: integer "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "401": description: Not Authorized "403": @@ -392,6 +416,10 @@ paths: description: No Content "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "404": description: Not Found "401": @@ -435,6 +463,12 @@ paths: text/plain: schema: type: string + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "404": description: Not Found "413": @@ -479,6 +513,10 @@ paths: description: OK "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "404": description: Not Found "401": @@ -524,6 +562,10 @@ paths: type: string "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "404": description: Not Found "401": @@ -563,6 +605,10 @@ paths: $ref: "#/components/schemas/Comment" "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "404": description: Not Found "401": @@ -599,6 +645,10 @@ paths: $ref: "#/components/schemas/Comment" "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "403": description: Not Allowed content: @@ -637,8 +687,6 @@ paths: schema: format: int64 type: integer - "400": - description: Bad Request "404": description: Not Found "401": @@ -673,6 +721,10 @@ paths: description: No Content "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "403": description: Not Allowed content: @@ -711,6 +763,10 @@ paths: description: OK "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "404": description: Not Found "401": @@ -751,6 +807,10 @@ paths: description: OK "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "403": description: Not Allowed content: @@ -788,6 +848,10 @@ paths: description: OK "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "403": description: Not Allowed content: @@ -823,6 +887,12 @@ paths: description: Unexpected error "200": description: OK + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "404": description: Not Found "401": @@ -856,6 +926,10 @@ paths: description: OK "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "404": description: Not Found "401": @@ -889,6 +963,10 @@ paths: description: OK "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "403": description: Not Allowed content: @@ -927,6 +1005,10 @@ paths: $ref: "#/components/schemas/Report" "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "401": description: Not Authorized "403": @@ -959,6 +1041,10 @@ paths: $ref: "#/components/schemas/Subscription" "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "401": description: Not Authorized "403": @@ -1030,6 +1116,10 @@ paths: type: string "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "404": description: Not Found /tokens/new: @@ -1077,6 +1167,10 @@ paths: description: OK "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "403": description: Not Allowed content: @@ -1153,6 +1247,12 @@ paths: type: array items: $ref: "#/components/schemas/Profile" + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "401": description: Not Authorized "403": @@ -1276,6 +1376,7 @@ paths: content: text/plain: schema: + maxLength: 3000 type: string required: true responses: @@ -1289,6 +1390,10 @@ paths: type: string "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "401": description: Not Authorized "403": @@ -1368,6 +1473,10 @@ paths: description: OK "400": description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "403": description: Not Allowed content: @@ -1403,6 +1512,12 @@ paths: description: Unexpected error "200": description: OK + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ViolationReport" "403": description: Not Allowed content: diff --git a/Fyreplace/Views/Screens/EmailsScreenProtocol.swift b/Fyreplace/Views/Screens/EmailsScreenProtocol.swift index 7c73bd5..724fed2 100644 --- a/Fyreplace/Views/Screens/EmailsScreenProtocol.swift +++ b/Fyreplace/Views/Screens/EmailsScreenProtocol.swift @@ -30,6 +30,12 @@ extension EmailsScreenProtocol { return nil + case .badRequest: + return .failure( + title: "Error.BadRequest.Title", + text: "Error.BadRequest.Message" + ) + case .unauthorized: return .authorizationIssue() diff --git a/Fyreplace/Views/Screens/SettingsScreenProtocol.swift b/Fyreplace/Views/Screens/SettingsScreenProtocol.swift index 2cb21d5..e3f321a 100644 --- a/Fyreplace/Views/Screens/SettingsScreenProtocol.swift +++ b/Fyreplace/Views/Screens/SettingsScreenProtocol.swift @@ -114,7 +114,7 @@ extension SettingsScreenProtocol { return nil - case .badRequest(_): + case .badRequest: return .failure( title: "Error.BadRequest.Title", text: "Error.BadRequest.Message"