Package com.linkedin.data.schema.validation

Examples of com.linkedin.data.schema.validation.ValidationOptions


    // Validate against the class schema with FixupMode.STRING_TO_PRIMITIVE to parse the
    // strings into the
    // corresponding primitive types.
    ValidateDataAgainstSchema.validate(recordTemplate.data(),
                                       recordTemplate.schema(),
                                       new ValidationOptions(RequiredMode.CAN_BE_ABSENT_IF_HAS_DEFAULT,
                                                             CoercionMode.STRING_TO_PRIMITIVE));
    return recordTemplate;
  }
View Full Code Here


                                                                     RootSimpleResource.class,
                                                                     CollectionUnderSimpleResource.class,
                                                                     SimpleResourceUnderCollectionResource.class);
    final ResourceSchemaCollection resourceSchemas = ResourceSchemaCollection.loadOrCreateResourceSchema(resources);
    final DataSchemaResolver schemaResolver = new ClassNameDataSchemaResolver();
    final ValidationOptions valOptions = new ValidationOptions(RequiredMode.MUST_BE_PRESENT);
    ExampleRequestResponse capture;
    ValidationResult valRet;

    final ResourceSchema greetings = resourceSchemas.getResource("greetings");
    ExampleRequestResponseGenerator greetingsGenerator = new ExampleRequestResponseGenerator(greetings, schemaResolver);
View Full Code Here

  @Test
  public void testRecordSchema()
  {
    final RecordDataSchema schema = (RecordDataSchema) DataTemplateUtil.getSchema(Certification.class);
    final DataMap value = SchemaSampleDataGenerator.buildRecordData(schema, _spec);
    final ValidationResult result = ValidateDataAgainstSchema.validate(value, schema, new ValidationOptions());
    Assert.assertTrue(result.isValid(), Arrays.toString(result.getMessages().toArray()));
  }
View Full Code Here

TOP

Related Classes of com.linkedin.data.schema.validation.ValidationOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.