-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: should not yield 404 when serverside SDK tries to register (#85)
Co-authored-by: Thomas Heartman <[email protected]>
- Loading branch information
1 parent
c41df56
commit 07c6c66
Showing
7 changed files
with
255 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { OpenAPIV3 } from 'openapi-types'; | ||
|
||
export const registerClientRequest: OpenAPIV3.RequestBodyObject = { | ||
content: { | ||
'application/json': { | ||
schema: { | ||
$ref: '#/components/schemas/registerClientSchema', | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { createSchemaObject, CreateSchemaType } from '../openapi-types'; | ||
|
||
export const schema = { | ||
type: 'object', | ||
required: ['appName', 'interval', 'started', 'strategies'], | ||
properties: { | ||
appName: { | ||
type: 'string', | ||
description: 'Name of the application using Unleash', | ||
}, | ||
instanceId: { | ||
type: 'string', | ||
description: | ||
'Instance id for this application (typically hostname, podId or similar)', | ||
}, | ||
sdkVersion: { | ||
type: 'string', | ||
description: | ||
'Optional field that describes the sdk version (name:version)', | ||
}, | ||
environment: { | ||
type: 'string', | ||
deprecated: true, | ||
}, | ||
interval: { | ||
type: 'number', | ||
description: | ||
'At which interval, in milliseconds, will this client be expected to send metrics', | ||
}, | ||
started: { | ||
oneOf: [ | ||
{ type: 'string', format: 'date-time' }, | ||
{ type: 'number' }, | ||
], | ||
description: | ||
'When this client started. Should be reported as ISO8601 time.', | ||
}, | ||
strategies: { | ||
type: 'array', | ||
items: { | ||
type: 'string', | ||
}, | ||
description: 'List of strategies implemented by this application', | ||
}, | ||
}, | ||
} as const; | ||
|
||
export type RegisterClientSchema = CreateSchemaType<typeof schema>; | ||
|
||
export const registerClientSchema = createSchemaObject(schema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters