Support for version upgrade during schema-validation
There is intensive use of $ref
to schema fragments, which are incoming as schema-IDs like e.g. "$ref": "osdu:wks:AbstractSpatialLocation:1.0.0"
. These fragments use semantic versioning as well.
As a consequence, these ids should be validated also during schema-validation:
- $ref target versions for patch increments can only refer to higher patch versions - if they refer to a higher minor (or even major version) validation must fail.
Example:
Sl No | Type | Initial Version | New Version | Status |
---|---|---|---|---|
1 | Base Schema | osdu:wks:AbstractSpatialLocation:1.0.0 | osdu:wks:AbstractSpatialLocation:1.0.1 | |
2 | $ref | osdu:wks:AbstractCommonResources:2.1.1 | osdu:wks:AbstractCommonResources:2.1.2 | valid |
3 | $ref | osdu:wks:AbstractCommonResources:2.1.1 | osdu:wks:AbstractCommonResources:2.2.1 | invalid |
4 | $ref | osdu:wks:AbstractCommonResources:2.1.1 | osdu:wks:AbstractCommonResources:2.0.1 | invalid |
5 | $ref | osdu:wks:AbstractCommonResources:2.1.1 | osdu:wks:AbstractCommonResources:2.1.0 | invalid |
6 | $ref | osdu:wks:AbstractCommonResources:2.1.1 | osdu:wks:AbstractCommonResources:3.1.1 | invalid |
7 | $ref | osdu:wks:AbstractCommonResources:2.1.1 | osdu:wks:AbstractCommonResources-Changed:2.1.1 | invalid |
- Similarly $ref target versions for higher minor versions can only refer to higher minor versions - higher major version references must be rejected by the validation.
Example:
Sl No | Type | Initial Version | New Version | Status |
---|---|---|---|---|
1 | Base Schema | osdu:wks:AbstractSpatialLocation:1.0.0 | osdu:wks:AbstractSpatialLocation:1.1.0 | |
2 | $ref | osdu:wks:AbstractCommonResources:2.1.1 | osdu:wks:AbstractCommonResources:2.1.2 | valid |
3 | $ref | osdu:wks:AbstractCommonResources:2.1.1 | osdu:wks:AbstractCommonResources:2.2.1 | valid |
4 | $ref | osdu:wks:AbstractCommonResources:2.1.1 | osdu:wks:AbstractCommonResources:2.0.1 | invalid |
5 | $ref | osdu:wks:AbstractCommonResources:2.1.1 | osdu:wks:AbstractCommonResources:2.1.0 | invalid |
6 | $ref | osdu:wks:AbstractCommonResources:2.1.1 | osdu:wks:AbstractCommonResources:3.1.1 | invalid |
7 | $ref | osdu:wks:AbstractCommonResources:2.1.1 | osdu:wks:AbstractCommonResources-Changed:2.1.1 | invalid |
Edited by Abhishek Kumar (SLB)