Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • S Schema
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 25
    • Issues 25
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 10
    • Merge requests 10
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Open Subsurface Data Universe SoftwareOpen Subsurface Data Universe Software
  • Platform
  • System
  • Schema
  • Merge requests
  • !142

Schema ref validation changes

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Abhishek Kumar (SLB) requested to merge schema-ref-validation into master Aug 02, 2021
  • Overview 33
  • Commits 46
  • Pipelines 86
  • Changes 200

This MR introduces validation rule for $ref fragments. Basically, if there are minor level changes in the schema then all the $ref components of that schema are allowed to have incremental changes in their $ref versioning (incremental change in minor and patch level versioning). In other words, the schemas pointed by $ref can also have all permissible changes that are allowed at the Minor level (for more details please refer here [https://community.opengroup.org/osdu/platform/system/schema-service/-/blob/master/docs/SchemaService-OSDU.md#schema-validation].

Likewise, at the Patch level, $ref values are permitted to have incremented patch version. For more example, refere to the issue #61 (closed)

Code refactor

image

image

Along with the above state changes, there is code refactoring done to make components manageable and reusable. For example, earlier there were below classes:

  • schema-core/src/main/java/org/opengroup/osdu/schema/validation/SchemaMinorVersionValidator.java
  • schema-core/src/main/java/org/opengroup/osdu/schema/validation/SchemaPatchVersionValidator.java

which now, has evolved into different Handlers depending upon the kind of tags or operations they validate:

  • AdditionalPropertiesHandler
  • RemoveOperationHandler
  • RequiredAttributeHandler
  • TypeOperationHandler
  • CompositionPropertiesHandler
  • ReferenceAttributeHandler

Testing

There are comprehensive set of Unit and IT test cases added/updated. To have a good test coverage, we have included several JSON files at below locations:

  • https://community.opengroup.org/osdu/platform/system/schema-service/-/tree/schema-ref-validation/schema-core/src/test/resources/schema_compare [61 files]
  • https://community.opengroup.org/osdu/platform/system/schema-service/-/tree/master/testing/schema-test-core/src/test/resources/input_payloads [88 Files]
Edited Aug 18, 2021 by Abhishek Kumar (SLB)
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: schema-ref-validation