Skip to content

Commit

Permalink
Update API definition
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentTreguier committed Sep 4, 2024
1 parent e9ae30d commit b68ffd6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
20 changes: 20 additions & 0 deletions Fyreplace/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,26 @@
}
}
},
"Error.Forbidden.Message" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "An unauthorized request was sent to the server."
}
}
}
},
"Error.Forbidden.Title" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Forbidden"
}
}
}
},
"Error.Unknown" : {
"localizations" : {
"en" : {
Expand Down
20 changes: 7 additions & 13 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.3.0
version: v0.4.0
paths:
/emails:
get:
Expand Down Expand Up @@ -979,6 +979,8 @@ paths:
description: OK
"400":
description: Bad Request
"403":
description: Not Allowed
"404":
description: Not Found
/users:
Expand Down Expand Up @@ -1321,9 +1323,7 @@ components:
id:
$ref: "#/components/schemas/UUID"
dateCreated:
type: string
allOf:
- $ref: "#/components/schemas/Instant"
$ref: "#/components/schemas/Instant"
anonymous:
type: boolean
author:
Expand Down Expand Up @@ -1411,9 +1411,7 @@ components:
id:
$ref: "#/components/schemas/UUID"
dateCreated:
type: string
allOf:
- $ref: "#/components/schemas/Instant"
$ref: "#/components/schemas/Instant"
anonymous:
type: boolean
author:
Expand Down Expand Up @@ -1479,9 +1477,7 @@ components:
id:
$ref: "#/components/schemas/UUID"
dateCreated:
type: string
allOf:
- $ref: "#/components/schemas/Instant"
$ref: "#/components/schemas/Instant"
targetId:
$ref: "#/components/schemas/UUID"
source:
Expand Down Expand Up @@ -1550,9 +1546,7 @@ components:
id:
$ref: "#/components/schemas/UUID"
dateCreated:
type: string
allOf:
- $ref: "#/components/schemas/Instant"
$ref: "#/components/schemas/Instant"
username:
maxLength: 50
minLength: 3
Expand Down
2 changes: 2 additions & 0 deletions Fyreplace/Views/Screens/LoginScreenProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ extension LoginScreenProtocol {
return true
case .badRequest:
eventBus.send(.failure(title: "Error.BadRequest.Title", text: "Error.BadRequest.Message"))
case .forbidden:
eventBus.send(.failure(title: "Error.Forbidden.Title", text: "Error.Forbidden.Message"))
case .notFound:
eventBus.send(.failure(title: "Login.Error.NotFound.Title", text: "Login.Error.NotFound.Message"))
case .default:
Expand Down

0 comments on commit b68ffd6

Please sign in to comment.