Skip to content

Commit

Permalink
Update API definition
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentTreguier committed Nov 18, 2024
1 parent 78ea365 commit d93cd49
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 4 deletions.
121 changes: 118 additions & 3 deletions Fyreplace/Resources/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
openapi: 3.0.3
info:
title: Fyreplace API
version: v0.8.0
version: v0.9.0
paths:
/emails:
get:
Expand All @@ -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":
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -90,6 +102,10 @@ paths:
description: OK
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ViolationReport"
"404":
description: Not Found
"401":
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -263,6 +283,10 @@ paths:
type: integer
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ViolationReport"
"401":
description: Not Authorized
"403":
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -479,6 +513,10 @@ paths:
description: OK
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ViolationReport"
"404":
description: Not Found
"401":
Expand Down Expand Up @@ -524,6 +562,10 @@ paths:
type: string
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ViolationReport"
"404":
description: Not Found
"401":
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -637,8 +687,6 @@ paths:
schema:
format: int64
type: integer
"400":
description: Bad Request
"404":
description: Not Found
"401":
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -711,6 +763,10 @@ paths:
description: OK
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ViolationReport"
"404":
description: Not Found
"401":
Expand Down Expand Up @@ -751,6 +807,10 @@ paths:
description: OK
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ViolationReport"
"403":
description: Not Allowed
content:
Expand Down Expand Up @@ -788,6 +848,10 @@ paths:
description: OK
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ViolationReport"
"403":
description: Not Allowed
content:
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -856,6 +926,10 @@ paths:
description: OK
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ViolationReport"
"404":
description: Not Found
"401":
Expand Down Expand Up @@ -889,6 +963,10 @@ paths:
description: OK
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ViolationReport"
"403":
description: Not Allowed
content:
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -1077,6 +1167,10 @@ paths:
description: OK
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ViolationReport"
"403":
description: Not Allowed
content:
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -1276,6 +1376,7 @@ paths:
content:
text/plain:
schema:
maxLength: 3000
type: string
required: true
responses:
Expand All @@ -1289,6 +1390,10 @@ paths:
type: string
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ViolationReport"
"401":
description: Not Authorized
"403":
Expand Down Expand Up @@ -1368,6 +1473,10 @@ paths:
description: OK
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ViolationReport"
"403":
description: Not Allowed
content:
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions Fyreplace/Views/Screens/EmailsScreenProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ extension EmailsScreenProtocol {

return nil

case .badRequest:
return .failure(
title: "Error.BadRequest.Title",
text: "Error.BadRequest.Message"
)

case .unauthorized:
return .authorizationIssue()

Expand Down
2 changes: 1 addition & 1 deletion Fyreplace/Views/Screens/SettingsScreenProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ extension SettingsScreenProtocol {

return nil

case .badRequest(_):
case .badRequest:
return .failure(
title: "Error.BadRequest.Title",
text: "Error.BadRequest.Message"
Expand Down

0 comments on commit d93cd49

Please sign in to comment.