1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +01:00
unleash.unleash/src/lib/openapi/spec/create-application-schema.ts
Thomas Heartman 7ea4e5d5b9
chore: remove additionalProperterties: true annotation. (#4508)
Unless you set `additionalProperties` to `false`, additional properties
are always
allowed. By explicitly setting it to `true` the generated
examples contain additional properties, e.g.:

```json
{
  "tokens": [
    "aproject:development.randomstring",
    "[]:production.randomstring"
  ],
  "additionalProp1": {}
}
```

By removing the explicit annotation, we still allow additional
properties, but we don't get them in examples:

```json
{
  "tokens": [
    "aproject:development.randomstring",
    "[]:production.randomstring"
  ]
}
```
2023-08-16 11:17:05 +02:00

51 lines
2.0 KiB
TypeScript

import { FromSchema } from 'json-schema-to-ts';
export const createApplicationSchema = {
$id: '#/components/schemas/createApplicationSchema',
type: 'object',
description: 'Reported application information from Unleash SDKs',
properties: {
appName: {
description: 'Name of the application',
type: 'string',
example: 'accounting',
},
sdkVersion: {
description:
'Which SDK and version the application reporting uses. Typically represented as `<identifier>:<version>`',
type: 'string',
example: 'unleash-client-java:8.0.0',
},
strategies: {
description:
'Which [strategies](https://docs.getunleash.io/topics/the-anatomy-of-unleash#activation-strategies) the application has loaded. Useful when trying to figure out if your [custom strategy](https://docs.getunleash.io/reference/custom-activation-strategies) has been loaded in the SDK',
type: 'array',
items: {
type: 'string',
},
example: ['standard', 'gradualRollout', 'mySpecialCustomStrategy'],
},
url: {
description:
'A link to reference the application reporting the metrics. Could for instance be a GitHub link to the repository of the application',
type: 'string',
example: 'https://github.com/Unleash/unleash-client-proxy-js',
},
color: {
description: `Css color to be used to color the application's entry in the application list`,
type: 'string',
example: 'red',
},
icon: {
description: `An URL to an icon file to be used for the applications's entry in the application list`,
type: 'string',
example: 'https://github.com/favicon.ico',
},
},
components: {},
} as const;
export type CreateApplicationSchema = FromSchema<
typeof createApplicationSchema
>;