Skip to content

Commit

Permalink
Updating open-api specs (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
etoledom authored Oct 2, 2024
1 parent c3d9a63 commit db18b84
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ generate: $(OUTPUT_DIRECTORY) # Generates the open-api model
cp "$(OPENAPI_YAML_PATH)" "$(OPENAPI_GENERATOR_CLONE_DIR)"/openapi.yaml
mkdir -p "$(OPENAPI_GENERATOR_CLONE_DIR)"/templates
cp "$(MODEL_TEMPLATE_PATH)"/*.mustache "$(OPENAPI_GENERATOR_CLONE_DIR)"/templates/
rm -rf "$(OPENAPI_GENERATOR_CLONE_DIR)"/generated/OpenAPIClient/Classes/OpenAPIs/Models/*
"$(OPENAPI_GENERATOR_CLONE_DIR)"/run-in-docker.sh generate -i openapi.yaml \
--global-property models \
-t templates \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ package struct CheckTokenAuthorizationService: Sendable {
request.httpMethod = "GET"
do {
let (data, _) = try await client.fetchData(with: request)
let result: AssociatedEmail200Response = try data.decode()
let result: AssociatedResponse = try data.decode()
return result.associated
} catch {
throw error.apiError()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

public struct AssociatedEmail200Response: Codable, Hashable, Sendable {
/// Whether the email is associated with a Gravatar account.
public struct AssociatedResponse: Codable, Hashable, Sendable {
/// Whether the entity is associated with the account.
public private(set) var associated: Bool

@available(*, deprecated, message: "init will become internal on the next release")
Expand Down
19 changes: 11 additions & 8 deletions openapi/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,16 @@ components:
pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$
examples:
- '2021-10-01T12:00:00Z'
AssociatedResponse:
type: object
required:
- associated
properties:
associated:
type: boolean
description: Whether the entity is associated with the account.
examples:
- true
Error:
type: object
description: An error response from the API.
Expand Down Expand Up @@ -555,14 +565,7 @@ paths:
application/json:
schema:
type: object
required:
- associated
properties:
associated:
type: boolean
description: Whether the email is associated with a Gravatar account.
examples:
- true
$ref: '#/components/schemas/AssociatedResponse'
/me/avatars:
get:
summary: List avatars
Expand Down

0 comments on commit db18b84

Please sign in to comment.