1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-12-21 20:06:40 +01:00
unleash.unleash/src/lib/openapi/spec/token-string-list-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

23 lines
715 B
TypeScript

import { FromSchema } from 'json-schema-to-ts';
export const tokenStringListSchema = {
$id: '#/components/schemas/tokenStringListSchema',
type: 'object',
description: 'A list of unleash tokens to validate against known tokens',
required: ['tokens'],
properties: {
tokens: {
description: 'Tokens that we want to get access information about',
type: 'array',
items: { type: 'string' },
example: [
'aproject:development.randomstring',
'[]:production.randomstring',
],
},
},
components: {},
} as const;
export type TokenStringListSchema = FromSchema<typeof tokenStringListSchema>;