F1 (Java) Story 9: Implement ProjectSchemaValidator

Description

As a developer, I need to implement the ProjectSchemaValidator class that validates the provided collaboration project record JSON object against the "master-data--CollaborationProject" schema. The source of the jsonschema definition for this validation is out of the scope of the current task and can be provided as a result of an API call to the OSDU Schema service or packed as a file in the Java application resources.

Acceptance Criteria

  1. Successful implementation of ProjectSchemaValidator which retrieves the applicable OSDU schema and validates the provided JSON payload against this.
  2. If validation fails, a flag should be set or an exception should be thrown.

Technical Notes

For schema validation, Java has several well-known libraries. The developer could choose the most appropriate from the following list, or investigate if the existing OSDU Java services or common libraries have the necessary capabilities:

  1. json-schema-validator: A powerful tool that covers draft-04, draft-06, and draft-07 of JSON Schema specifications.
  2. Everit - Org.JSON Schema: A simple, lightweight library that fully validates JSON against draft-07, and also supports older drafts.
  3. NetworkNT JSON Schema: A fast JSON Schema validator that aligns with draft-04, draft-06, and draft-07.
Edited Feb 27, 2024 by Rostislav Dublin (EPAM)
Assignee Loading
Time tracking Loading