1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

Revert "fix: prevent non-string properties from being passed as context values" (#6702)

Reverts Unleash/unleash#6676
This commit is contained in:
Jaanus Sellin 2024-03-26 16:18:35 +02:00 committed by GitHub
parent 6762703db9
commit ab82543f54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 33 deletions

View File

@ -25,33 +25,3 @@ test('sdkContextSchema', () =>
validateSchema(sdkContextSchema.$id, data) === undefined, validateSchema(sdkContextSchema.$id, data) === undefined,
), ),
)); ));
test('using objects as values (outside of the `properties` property) is invalid', () => {
const inputs = [
{
appName: 'test',
array: [],
},
{
appName: 'test',
object: {},
},
{
appName: 'test',
properties: {
array: [],
},
},
{
appName: 'test',
properties: {
object: {},
},
},
];
const validationResults = inputs.map((input) =>
validateSchema(sdkContextSchema.$id, input),
);
expect(validationResults.every((error) => error !== undefined)).toBe(true);
});

View File

@ -5,9 +5,7 @@ export const sdkContextSchema = {
description: 'The Unleash context as modeled in client SDKs', description: 'The Unleash context as modeled in client SDKs',
type: 'object', type: 'object',
required: ['appName'], required: ['appName'],
additionalProperties: { additionalProperties: true,
type: 'string',
},
properties: { properties: {
appName: { appName: {
type: 'string', type: 'string',