How to use the body.nestedObject.arrayUniqueItem function in body

To help you get started, we’ve selected a few body examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lukeautry / tsoa / tests / integration / dynamic-controllers-express-server.spec.ts View on Github external
expect(body.fields['body.nestedObject.numberMax10'].message).to.equal('max 10');
          expect(body.fields['body.nestedObject.numberMax10'].value).to.equal(bodyModel.numberMax10);
          expect(body.fields['body.nestedObject.numberMin5'].message).to.equal('min 5');
          expect(body.fields['body.nestedObject.numberMin5'].value).to.equal(bodyModel.numberMin5);
          expect(body.fields['body.nestedObject.stringMax10Lenght'].message).to.equal('maxLength 10');
          expect(body.fields['body.nestedObject.stringMax10Lenght'].value).to.equal(bodyModel.stringMax10Lenght);
          expect(body.fields['body.nestedObject.stringMin5Lenght'].message).to.equal('minLength 5');
          expect(body.fields['body.nestedObject.stringMin5Lenght'].value).to.equal(bodyModel.stringMin5Lenght);
          expect(body.fields['body.nestedObject.stringPatternAZaz'].message).to.equal("Not match in '^[a-zA-Z]+$'");
          expect(body.fields['body.nestedObject.stringPatternAZaz'].value).to.equal(bodyModel.stringPatternAZaz);

          expect(body.fields['body.nestedObject.arrayMax5Item'].message).to.equal('maxItems 5');
          expect(body.fields['body.nestedObject.arrayMax5Item'].value).to.deep.equal(bodyModel.arrayMax5Item);
          expect(body.fields['body.nestedObject.arrayMin2Item'].message).to.equal('minItems 2');
          expect(body.fields['body.nestedObject.arrayMin2Item'].value).to.deep.equal(bodyModel.arrayMin2Item);
          expect(body.fields['body.nestedObject.arrayUniqueItem'].message).to.equal('required unique array');
          expect(body.fields['body.nestedObject.arrayUniqueItem'].value).to.deep.equal(bodyModel.arrayUniqueItem);
          expect(body.fields['body.nestedObject.model'].message).to.equal('invalid object');
          expect(body.fields['body.nestedObject.model'].value).to.deep.equal(bodyModel.model);
          expect(body.fields['body.nestedObject.mixedUnion'].message).to.equal(
            'Could not match the union against any of the items. ' +
              'Issues: [{"body.nestedObject.mixedUnion":{"message":"invalid string value","value":123}},' +
              '{"body.nestedObject.mixedUnion":{"message":"invalid object","value":123}}]',
          );
          expect(body.fields['body.nestedObject.intersection'].message).to.equal(
            'Could not match the intersection against every type. Issues: [{"body.nestedObject.value2":{"message":"\'value2\' is required"}}]',
          );
        },
        400,
github lukeautry / tsoa / tests / integration / openapi3-express.spec.ts View on Github external
expect(body.fields['body.nestedObject.numberMax10'].value).to.equal(bodyModel.numberMax10);
        expect(body.fields['body.nestedObject.numberMin5'].message).to.equal('min 5');
        expect(body.fields['body.nestedObject.numberMin5'].value).to.equal(bodyModel.numberMin5);
        expect(body.fields['body.nestedObject.stringMax10Lenght'].message).to.equal('maxLength 10');
        expect(body.fields['body.nestedObject.stringMax10Lenght'].value).to.equal(bodyModel.stringMax10Lenght);
        expect(body.fields['body.nestedObject.stringMin5Lenght'].message).to.equal('minLength 5');
        expect(body.fields['body.nestedObject.stringMin5Lenght'].value).to.equal(bodyModel.stringMin5Lenght);
        expect(body.fields['body.nestedObject.stringPatternAZaz'].message).to.equal("Not match in '^[a-zA-Z]+$'");
        expect(body.fields['body.nestedObject.stringPatternAZaz'].value).to.equal(bodyModel.stringPatternAZaz);

        expect(body.fields['body.nestedObject.arrayMax5Item'].message).to.equal('maxItems 5');
        expect(body.fields['body.nestedObject.arrayMax5Item'].value).to.deep.equal(bodyModel.arrayMax5Item);
        expect(body.fields['body.nestedObject.arrayMin2Item'].message).to.equal('minItems 2');
        expect(body.fields['body.nestedObject.arrayMin2Item'].value).to.deep.equal(bodyModel.arrayMin2Item);
        expect(body.fields['body.nestedObject.arrayUniqueItem'].message).to.equal('required unique array');
        expect(body.fields['body.nestedObject.arrayUniqueItem'].value).to.deep.equal(bodyModel.arrayUniqueItem);
        expect(body.fields['body.nestedObject.model'].message).to.equal('invalid object');
        expect(body.fields['body.nestedObject.model'].value).to.deep.equal(bodyModel.model);
        expect(body.fields['body.nestedObject.mixedUnion'].message).to.equal(
          'Could not match the union against any of the items. ' +
            'Issues: [{"body.nestedObject.mixedUnion":{"message":"invalid string value","value":123}},' +
            '{"body.nestedObject.mixedUnion":{"message":"invalid object","value":123}}]',
        );
        expect(body.fields['body.nestedObject.intersection'].message).to.equal(
          'Could not match the intersection against every type. Issues: [{"body.nestedObject.value2":{"message":"\'value2\' is required"}}]',
        );
      },
      400,
github lukeautry / tsoa / tests / integration / dynamic-controllers-express-server.spec.ts View on Github external
expect(body.fields['body.nestedObject.numberMax10'].value).to.equal(bodyModel.numberMax10);
          expect(body.fields['body.nestedObject.numberMin5'].message).to.equal('min 5');
          expect(body.fields['body.nestedObject.numberMin5'].value).to.equal(bodyModel.numberMin5);
          expect(body.fields['body.nestedObject.stringMax10Lenght'].message).to.equal('maxLength 10');
          expect(body.fields['body.nestedObject.stringMax10Lenght'].value).to.equal(bodyModel.stringMax10Lenght);
          expect(body.fields['body.nestedObject.stringMin5Lenght'].message).to.equal('minLength 5');
          expect(body.fields['body.nestedObject.stringMin5Lenght'].value).to.equal(bodyModel.stringMin5Lenght);
          expect(body.fields['body.nestedObject.stringPatternAZaz'].message).to.equal("Not match in '^[a-zA-Z]+$'");
          expect(body.fields['body.nestedObject.stringPatternAZaz'].value).to.equal(bodyModel.stringPatternAZaz);

          expect(body.fields['body.nestedObject.arrayMax5Item'].message).to.equal('maxItems 5');
          expect(body.fields['body.nestedObject.arrayMax5Item'].value).to.deep.equal(bodyModel.arrayMax5Item);
          expect(body.fields['body.nestedObject.arrayMin2Item'].message).to.equal('minItems 2');
          expect(body.fields['body.nestedObject.arrayMin2Item'].value).to.deep.equal(bodyModel.arrayMin2Item);
          expect(body.fields['body.nestedObject.arrayUniqueItem'].message).to.equal('required unique array');
          expect(body.fields['body.nestedObject.arrayUniqueItem'].value).to.deep.equal(bodyModel.arrayUniqueItem);
          expect(body.fields['body.nestedObject.model'].message).to.equal('invalid object');
          expect(body.fields['body.nestedObject.model'].value).to.deep.equal(bodyModel.model);
          expect(body.fields['body.nestedObject.mixedUnion'].message).to.equal(
            'Could not match the union against any of the items. ' +
              'Issues: [{"body.nestedObject.mixedUnion":{"message":"invalid string value","value":123}},' +
              '{"body.nestedObject.mixedUnion":{"message":"invalid object","value":123}}]',
          );
          expect(body.fields['body.nestedObject.intersection'].message).to.equal(
            'Could not match the intersection against every type. Issues: [{"body.nestedObject.value2":{"message":"\'value2\' is required"}}]',
          );
        },
        400,
github lukeautry / tsoa / tests / integration / openapi3-express.spec.ts View on Github external
expect(body.fields['body.nestedObject.numberMax10'].message).to.equal('max 10');
        expect(body.fields['body.nestedObject.numberMax10'].value).to.equal(bodyModel.numberMax10);
        expect(body.fields['body.nestedObject.numberMin5'].message).to.equal('min 5');
        expect(body.fields['body.nestedObject.numberMin5'].value).to.equal(bodyModel.numberMin5);
        expect(body.fields['body.nestedObject.stringMax10Lenght'].message).to.equal('maxLength 10');
        expect(body.fields['body.nestedObject.stringMax10Lenght'].value).to.equal(bodyModel.stringMax10Lenght);
        expect(body.fields['body.nestedObject.stringMin5Lenght'].message).to.equal('minLength 5');
        expect(body.fields['body.nestedObject.stringMin5Lenght'].value).to.equal(bodyModel.stringMin5Lenght);
        expect(body.fields['body.nestedObject.stringPatternAZaz'].message).to.equal("Not match in '^[a-zA-Z]+$'");
        expect(body.fields['body.nestedObject.stringPatternAZaz'].value).to.equal(bodyModel.stringPatternAZaz);

        expect(body.fields['body.nestedObject.arrayMax5Item'].message).to.equal('maxItems 5');
        expect(body.fields['body.nestedObject.arrayMax5Item'].value).to.deep.equal(bodyModel.arrayMax5Item);
        expect(body.fields['body.nestedObject.arrayMin2Item'].message).to.equal('minItems 2');
        expect(body.fields['body.nestedObject.arrayMin2Item'].value).to.deep.equal(bodyModel.arrayMin2Item);
        expect(body.fields['body.nestedObject.arrayUniqueItem'].message).to.equal('required unique array');
        expect(body.fields['body.nestedObject.arrayUniqueItem'].value).to.deep.equal(bodyModel.arrayUniqueItem);
        expect(body.fields['body.nestedObject.model'].message).to.equal('invalid object');
        expect(body.fields['body.nestedObject.model'].value).to.deep.equal(bodyModel.model);
        expect(body.fields['body.nestedObject.mixedUnion'].message).to.equal(
          'Could not match the union against any of the items. ' +
            'Issues: [{"body.nestedObject.mixedUnion":{"message":"invalid string value","value":123}},' +
            '{"body.nestedObject.mixedUnion":{"message":"invalid object","value":123}}]',
        );
        expect(body.fields['body.nestedObject.intersection'].message).to.equal(
          'Could not match the intersection against every type. Issues: [{"body.nestedObject.value2":{"message":"\'value2\' is required"}}]',
        );
      },
      400,