diff --git a/Sources/Gravatar/Network/Services/ProfileService.swift b/Sources/Gravatar/Network/Services/ProfileService.swift index 1aaa61df..a9ddbe1c 100644 --- a/Sources/Gravatar/Network/Services/ProfileService.swift +++ b/Sources/Gravatar/Network/Services/ProfileService.swift @@ -31,7 +31,7 @@ public struct ProfileService: ProfileFetching, Sendable { package func fetchAvatars(with token: String, id: ProfileIdentifier) async throws -> [Avatar] { do { - guard let url = avatarsBaseURLComponents.settingQueryItems([.init(name: "selected_email", value: id.id)]).url else { + guard let url = avatarsBaseURLComponents.settingQueryItems([.init(name: "selected_email_hash", value: id.id)]).url else { throw APIError.requestError(reason: .urlInitializationFailed) } let request = URLRequest(url: url).settingAuthorizationHeaderField(with: token) diff --git a/Sources/Gravatar/OpenApi/Generated/ModelError.swift b/Sources/Gravatar/OpenApi/Generated/ModelError.swift index 13562faf..d2e69a33 100644 --- a/Sources/Gravatar/OpenApi/Generated/ModelError.swift +++ b/Sources/Gravatar/OpenApi/Generated/ModelError.swift @@ -1,5 +1,7 @@ import Foundation +/// An error response from the API. +/// public struct ModelError: Codable, Hashable, Sendable { /// The error message public private(set) var error: String diff --git a/openapi/spec.yaml b/openapi/spec.yaml index 8296e914..5af4966c 100644 --- a/openapi/spec.yaml +++ b/openapi/spec.yaml @@ -49,6 +49,7 @@ components: image_url: type: string description: Image URL + format: uri examples: - >- https://gravatar.com/userimage/252014526/d38bele5a98a2bbc40df69172a2a8348.jpeg @@ -450,6 +451,7 @@ components: - '2021-10-01T12:00:00Z' Error: type: object + description: An error response from the API. properties: error: type: string @@ -571,12 +573,12 @@ paths: security: - oauth: [] parameters: - - name: selected_email + - name: selected_email_hash in: query description: >- - The email address used to determine which avatar is selected. The - 'selected' attribute in the avatar list will be set to 'true' for - the avatar associated with this email. + The sha256 hash of the email address used to determine which avatar + is selected. The 'selected' attribute in the avatar list will be set + to 'true' for the avatar associated with this email. schema: type: string default: null @@ -667,4 +669,3 @@ paths: responses: '204': description: Avatar successfully set -