Skip to content

Commit c366a2e

Browse files
authored
Fix JSON attribute inconsistencies (#12)
1 parent b9757aa commit c366a2e

File tree

2 files changed

+36
-131
lines changed

2 files changed

+36
-131
lines changed

openapi.yaml

Lines changed: 18 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -190,62 +190,22 @@ components:
190190
type: string
191191
description: A UUID that uniquely identifies the request.
192192
format: uuid
193-
APIKey:
193+
ServiceAccount:
194194
type: object
195195
properties:
196+
uuid:
197+
type: string
198+
description: The UUID of the service account.
199+
format: uuid
196200
apiKey:
197201
type: string
198-
description: The API key.
199-
Audience:
200-
type: object
201-
properties:
202-
apiKeys:
203-
type: array
204-
description: API keys for this audience.
205-
items:
206-
$ref: '#/components/schemas/APIKey'
202+
description: The API key of the service account.
207203
aud:
208204
type: string
209-
description: The audience of JWTs created for this service account context.
210-
serviceLogo:
211-
type: string
212-
description: The URL of the service account's service logo.
213-
serviceName:
214-
type: string
215-
description: The name of the service account's service.
216-
serviceURL:
217-
type: string
218-
description: The URL of the landing page for the service account's service.
219-
ServiceAccountMeta:
220-
type: object
221-
properties:
205+
description: The audience of the service account.
222206
admin:
223207
type: boolean
224208
description: Whether the service account is an admin.
225-
uuid:
226-
type: string
227-
description: The UUID of the service account.
228-
format: uuid
229-
ServiceAccount:
230-
type: object
231-
properties:
232-
audiences:
233-
type: array
234-
description: The audiences for this service account.
235-
items:
236-
$ref: '#/components/schemas/Audience'
237-
meta:
238-
$ref: '#/components/schemas/ServiceAccountMeta'
239-
JWTClaims:
240-
type: object
241-
properties:
242-
claims:
243-
type: object
244-
properties: {}
245-
description: Any valid JSON object. Do not provide any JSON attributes mentioned
246-
in RFC 7519 section 4.1 as this will cause an error. These are JWT "Registered
247-
Claim Names".
248-
description: Any valid JSON object.
249209
JWTCreateRequest:
250210
required:
251211
- jwtCreateArgs
@@ -263,7 +223,15 @@ components:
263223
on the server's configuration. The default server configuration is "EdDSA".
264224
The default server options are "EdDSA" and "RS256".
265225
jwtClaims:
266-
$ref: '#/components/schemas/JWTClaims'
226+
type: object
227+
properties:
228+
claims:
229+
type: object
230+
properties: {}
231+
description: Any valid JSON object. Do not provide any JSON attributes
232+
mentioned in RFC 7519 section 4.1 as this will cause an error. These
233+
are JWT "Registered Claim Names".
234+
description: The JWT claims used to create the signed JWT.
267235
jwtLifespanSeconds:
268236
type: integer
269237
description: "The lifespan of the JWT in seconds. The JWT's lifespan starts\
@@ -319,8 +287,6 @@ components:
319287
$ref: '#/components/schemas/RequestMetadata'
320288
description: The response body for the /jwt/validate endpoint.
321289
LinkCreateArgs:
322-
required:
323-
- redirectURL
324290
type: object
325291
properties:
326292
jwtCreateArgs:
@@ -334,7 +300,7 @@ components:
334300
type: string
335301
description: "The URL query key in the redirectURL to contain the signed\
336302
\ JWT when the magic link is used. By default, \"jwt\" is used."
337-
redirectURL:
303+
redirectUrl:
338304
type: string
339305
description: The URL to redirect to with the signed JWT when the link is
340306
used.
@@ -451,18 +417,6 @@ components:
451417
description: The response body from the /email-link/create endpoint.
452418
ServiceAccountCreateArgs:
453419
type: object
454-
properties:
455-
serviceLogo:
456-
type: string
457-
description: The URL of the service account's service's logo.
458-
format: uri
459-
serviceName:
460-
type: string
461-
description: The name of the service account's service.
462-
serviceURL:
463-
type: string
464-
description: The landing page URL for the service account's service.
465-
format: uri
466420
description: Parameters to create a service account.
467421
ServiceAccountCreateRequest:
468422
required:
@@ -481,7 +435,7 @@ components:
481435
ServiceAccountCreateResponse:
482436
type: object
483437
properties:
484-
serviceAccountCreateResults:
438+
createServiceAccountResults:
485439
$ref: '#/components/schemas/ServiceAccountCreateResults'
486440
requestMetadata:
487441
$ref: '#/components/schemas/RequestMetadata'

swagger.yaml

Lines changed: 18 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -177,67 +177,22 @@ definitions:
177177
description: "A UUID that uniquely identifies the request."
178178
format: "uuid"
179179

180-
APIKey:
180+
ServiceAccount:
181181
type: "object"
182182
properties:
183+
uuid:
184+
type: "string"
185+
description: "The UUID of the service account."
186+
format: "uuid"
183187
apiKey:
184188
type: "string"
185-
description: "The API key."
186-
187-
Audience:
188-
type: "object"
189-
properties:
190-
apiKeys:
191-
type: "array"
192-
description: "API keys for this audience."
193-
items:
194-
$ref: "#/definitions/APIKey"
189+
description: "The API key of the service account."
195190
aud:
196191
type: "string"
197-
description: "The audience of JWTs created for this service account context."
198-
serviceLogo:
199-
type: "string"
200-
description: "The URL of the service account's service logo."
201-
serviceName:
202-
type: "string"
203-
description: "The name of the service account's service."
204-
serviceURL:
205-
type: "string"
206-
description: "The URL of the landing page for the service account's service."
207-
208-
ServiceAccountMeta:
209-
type: "object"
210-
properties:
192+
description: "The audience of the service account."
211193
admin:
212194
type: "boolean"
213195
description: "Whether the service account is an admin."
214-
uuid:
215-
type: "string"
216-
description: "The UUID of the service account."
217-
format: "uuid"
218-
219-
ServiceAccount:
220-
type: "object"
221-
properties:
222-
audiences:
223-
type: "array"
224-
description: "The audiences for this service account."
225-
items:
226-
$ref: "#/definitions/Audience"
227-
meta:
228-
$ref: "#/definitions/ServiceAccountMeta"
229-
230-
JWTClaims:
231-
description: "Any valid JSON object."
232-
type: "object"
233-
properties:
234-
claims:
235-
description: 'Any valid JSON object. Do not provide any JSON attributes mentioned in RFC 7519 section 4.1 as
236-
this will cause an error. These are JWT "Registered Claim Names".'
237-
type: "object"
238-
externalDocs:
239-
description: "RFC 7519 section 4.1"
240-
url: "https://tools.ietf.org/html/rfc7519#section-4.1"
241196

242197
JWTCreateRequest:
243198
description: "The request body for the /jwt/create endpoint."
@@ -258,7 +213,15 @@ definitions:
258213
type: "string"
259214
jwtClaims:
260215
description: "The JWT claims used to create the signed JWT."
261-
$ref: "#/definitions/JWTClaims"
216+
type: "object"
217+
properties:
218+
claims:
219+
description: 'Any valid JSON object. Do not provide any JSON attributes mentioned in RFC 7519 section 4.1 as
220+
this will cause an error. These are JWT "Registered Claim Names".'
221+
type: "object"
222+
externalDocs:
223+
description: "RFC 7519 section 4.1"
224+
url: "https://tools.ietf.org/html/rfc7519#section-4.1"
262225
jwtLifespanSeconds:
263226
description: "The lifespan of the JWT in seconds. The JWT's lifespan starts after the magic link has been
264227
visited and the JWT is signed. It defaults to 5 minutes. The minimum value is 5 and the maximum value is
@@ -337,7 +300,7 @@ definitions:
337300
description: 'The URL query key in the redirectURL to contain the signed JWT when the magic link is used. By
338301
default, "jwt" is used.'
339302
type: "string"
340-
redirectURL:
303+
redirectUrl:
341304
description: "The URL to redirect to with the signed JWT when the link is used."
342305
type: "string"
343306
required:
@@ -459,18 +422,6 @@ definitions:
459422
ServiceAccountCreateArgs:
460423
description: "Parameters to create a service account."
461424
type: "object"
462-
properties:
463-
serviceLogo:
464-
description: "The URL of the service account's service's logo."
465-
type: "string"
466-
format: "uri"
467-
serviceName:
468-
description: "The name of the service account's service."
469-
type: "string"
470-
serviceURL:
471-
description: "The landing page URL for the service account's service."
472-
type: "string"
473-
format: "uri"
474425

475426
ServiceAccountCreateRequest:
476427
description: "The request body for the /admin/service-account/create endpoint."
@@ -493,7 +444,7 @@ definitions:
493444
description: "The response body for the /admin/service-account/create endpoint."
494445
type: "object"
495446
properties:
496-
serviceAccountCreateResults:
447+
createServiceAccountResults:
497448
$ref: "#/definitions/ServiceAccountCreateResults"
498449
requestMetadata:
499450
$ref: "#/definitions/RequestMetadata"

0 commit comments

Comments
 (0)