1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-09 01:17:06 +02:00

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"
  ]
}
```
This commit is contained in:
Thomas Heartman 2023-08-16 11:17:05 +02:00 committed by GitHub
parent a2bd7d42a1
commit 7ea4e5d5b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 0 additions and 10 deletions

View File

@ -5,7 +5,6 @@ export const clientMetricsEnvSchema = {
$id: '#/components/schemas/clientMetricsEnvSchema', $id: '#/components/schemas/clientMetricsEnvSchema',
type: 'object', type: 'object',
required: ['featureName', 'appName', 'environment'], required: ['featureName', 'appName', 'environment'],
additionalProperties: true,
description: 'Used for reporting feature evaluation results from SDKs', description: 'Used for reporting feature evaluation results from SDKs',
properties: { properties: {
featureName: { featureName: {

View File

@ -3,7 +3,6 @@ import { FromSchema } from 'json-schema-to-ts';
export const createApplicationSchema = { export const createApplicationSchema = {
$id: '#/components/schemas/createApplicationSchema', $id: '#/components/schemas/createApplicationSchema',
type: 'object', type: 'object',
additionalProperties: true,
description: 'Reported application information from Unleash SDKs', description: 'Reported application information from Unleash SDKs',
properties: { properties: {
appName: { appName: {

View File

@ -4,7 +4,6 @@ import { groupSchema } from './group-schema';
export const createGroupSchema = { export const createGroupSchema = {
$id: '#/components/schemas/createGroupSchema', $id: '#/components/schemas/createGroupSchema',
type: 'object', type: 'object',
additionalProperties: true,
required: ['name'], required: ['name'],
description: 'A detailed information about a user group', description: 'A detailed information about a user group',
properties: { properties: {

View File

@ -3,7 +3,6 @@ import { FromSchema } from 'json-schema-to-ts';
export const createStrategyVariantSchema = { export const createStrategyVariantSchema = {
$id: '#/components/schemas/createStrategyVariantSchema', $id: '#/components/schemas/createStrategyVariantSchema',
type: 'object', type: 'object',
additionalProperties: true,
description: description:
"This is an experimental property. It may change or be removed as we work on it. Please don't depend on it yet. A strategy variant allows you to attach any data to strategies instead of only returning `true`/`false`. Strategy variants take precedence over feature variants.", "This is an experimental property. It may change or be removed as we work on it. Please don't depend on it yet. A strategy variant allows you to attach any data to strategies instead of only returning `true`/`false`. Strategy variants take precedence over feature variants.",
required: ['name', 'weight', 'weightType', 'stickiness'], required: ['name', 'weight', 'weightType', 'stickiness'],

View File

@ -7,7 +7,6 @@ const eventDataSchema = {
type: 'object', type: 'object',
nullable: true, nullable: true,
'x-enforcer-exception-skip-codes': 'WSCH006', // allow additional properties in example (openapi enforcer) 'x-enforcer-exception-skip-codes': 'WSCH006', // allow additional properties in example (openapi enforcer)
additionalProperties: true,
description: description:
'Extra associated data related to the event, such as feature toggle state, segment configuration, etc., if applicable.', 'Extra associated data related to the event, such as feature toggle state, segment configuration, etc., if applicable.',
example: { example: {

View File

@ -3,7 +3,6 @@ import { FromSchema } from 'json-schema-to-ts';
export const exportQuerySchema = { export const exportQuerySchema = {
$id: '#/components/schemas/exportQuerySchema', $id: '#/components/schemas/exportQuerySchema',
type: 'object', type: 'object',
additionalProperties: true,
required: ['environment'], required: ['environment'],
description: description:
'Available query parameters for the [deprecated export/import](https://docs.getunleash.io/reference/deploy/import-export) functionality.', 'Available query parameters for the [deprecated export/import](https://docs.getunleash.io/reference/deploy/import-export) functionality.',

View File

@ -4,7 +4,6 @@ export const sdkContextSchema = {
$id: '#/components/schemas/sdkContextSchema', $id: '#/components/schemas/sdkContextSchema',
description: 'The Unleash context as modeled in client SDKs', description: 'The Unleash context as modeled in client SDKs',
type: 'object', type: 'object',
additionalProperties: true,
required: ['appName'], required: ['appName'],
properties: { properties: {
appName: { appName: {

View File

@ -15,7 +15,6 @@ import { strategyVariantSchema } from './strategy-variant-schema';
export const stateSchema = { export const stateSchema = {
$id: '#/components/schemas/stateSchema', $id: '#/components/schemas/stateSchema',
type: 'object', type: 'object',
additionalProperties: true,
deprecated: true, deprecated: true,
description: description:
'The application state as used by the deprecated export/import APIs.', 'The application state as used by the deprecated export/import APIs.',

View File

@ -3,7 +3,6 @@ import { FromSchema } from 'json-schema-to-ts';
export const tokenStringListSchema = { export const tokenStringListSchema = {
$id: '#/components/schemas/tokenStringListSchema', $id: '#/components/schemas/tokenStringListSchema',
type: 'object', type: 'object',
additionalProperties: true,
description: 'A list of unleash tokens to validate against known tokens', description: 'A list of unleash tokens to validate against known tokens',
required: ['tokens'], required: ['tokens'],
properties: { properties: {

View File

@ -3,7 +3,6 @@ import { FromSchema } from 'json-schema-to-ts';
export const updateUserSchema = { export const updateUserSchema = {
$id: '#/components/schemas/updateUserSchema', $id: '#/components/schemas/updateUserSchema',
type: 'object', type: 'object',
additionalProperties: true,
description: 'All fields that can be directly changed for the user', description: 'All fields that can be directly changed for the user',
properties: { properties: {
email: { email: {