Skip to content

Commit

Permalink
feat(spec): include redirect_uris in application update schema (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mierenga authored Apr 11, 2024
1 parent 6b27676 commit fc4801f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
5 changes: 5 additions & 0 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,13 @@ components:
event_type:
type: string
enum: [update_application]
redirect_uris:
type: array
items:
type: string
required:
- event_type
- redirect_uris
EventHookAddRegistration:
additionalProperties: false
properties:
Expand Down
10 changes: 8 additions & 2 deletions src/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ describe('dcr handlers', () => {
application_description: 'description',
portal_id: '3fa85f64-5717-4562-b3fc-2c963f66afa7',
organization_id: '3fa85f64-5717-4562-b3fc-2c963f66afa8',
developer_id: '426ac0a7-aeb6-4043-a404-c4bfe24f2707'
developer_id: '426ac0a7-aeb6-4043-a404-c4bfe24f2707',
redirect_uris: [
'https://example.com'
]
}

const resp = await app.inject({
Expand Down Expand Up @@ -309,7 +312,10 @@ describe('dcr handlers', () => {
application_description: 'description',
portal_id: '3fa85f64-5717-4562-b3fc-2c963f66afa7',
organization_id: '3fa85f64-5717-4562-b3fc-2c963f66afa8',
developer_id: '426ac0a7-aeb6-4043-a404-c4bfe24f2707'
developer_id: '426ac0a7-aeb6-4043-a404-c4bfe24f2707',
redirect_uris: [
'https://example.com'
]
}

const resp = await app.inject({
Expand Down
12 changes: 11 additions & 1 deletion src/schemas/EventHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type EventHook = {
developer_id: string
} & (
| {
redirect_uris: string[]
event_type: 'update_application'
}
| {
Expand Down Expand Up @@ -94,9 +95,18 @@ export const EventHookSchema = {
properties: {
event_type: {
const: 'update_application'
},
redirect_uris: {
type: 'array',
items: {
type: 'string'
}
}
},
required: ['event_type']
required: [
'event_type',
'redirect_uris'
]
},
{
properties: {
Expand Down

0 comments on commit fc4801f

Please sign in to comment.