-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take superseding schema into account during validation (close #751)
- Loading branch information
Showing
19 changed files
with
521 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ class ApiRequestEnrichmentSpec extends Specification with CatsIO { | |
) | ||
val expected = Map( | ||
"unstruct_event" -> json"""{"schema":"iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0","data":{"schema":"iglu:com.snowplowanalytics.snowplow-website/signup_form_submitted/jsonschema/1-0-0","data":{"name":"Bob®","email":"[email protected]","company":"SP","eventsPerMonth":"< 1 million","serviceType":"unsure"}}}""".noSpaces, | ||
"contexts" -> json"""{"data":[{"data":{"osType":"OSX","appleIdfa":"some_appleIdfa","openIdfa":"some_Idfa","carrier":"some_carrier","deviceModel":"large","osVersion":"3.0.0","appleIdfa":"some_appleIdfa","androidIdfa":"some_androidIdfa","deviceManufacturer":"Amstrad"},"schema":"iglu:com.snowplowanalytics.snowplow/mobile_context/jsonschema/1-0-0"},{"data":{"longitude":10,"bearing":50,"speed":16,"altitude":20,"altitudeAccuracy":0.3,"latitudeLongitudeAccuracy":0.5,"latitude":7},"schema":"iglu:com.snowplowanalytics.snowplow/geolocation_context/jsonschema/1-0-0"}],"schema":"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0"}""".noSpaces, | ||
"contexts" -> json"""{"data":[{"data":{"osType":"OSX","appleIdfa":"some_appleIdfa","openIdfa":"some_Idfa","carrier":"some_carrier","deviceModel":"large","osVersion":"3.0.0","appleIdfa":"some_appleIdfa","androidIdfa":"some_androidIdfa","deviceManufacturer":"Amstrad"},"schema":"iglu:com.snowplowanalytics.snowplow/mobile_context/jsonschema/1-0-0"},{"data":{"longitude":10,"bearing":50,"speed":16,"altitude":20,"altitudeAccuracy":0.3,"latitudeLongitudeAccuracy":0.5,"latitude":7},"schema":"iglu:com.snowplowanalytics.snowplow/geolocation_context/jsonschema/1-0-0"}],"schema":"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-1"}""".noSpaces, | ||
"derived_contexts" -> json"""{"schema":"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-1","data":[{"schema":"iglu:com.statusgator/status_change/jsonschema/1-0-0","data":{"serviceName": "sp-api-request-enrichment"}}]}""".noSpaces | ||
) | ||
BlackBoxTesting.runTest(input, expected, Some(ApiRequestEnrichmentSpec.conf)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...mon/src/test/resources/iglu-schemas/schemas/com.acme/superseding_example/jsonschema/1-0-0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#", | ||
"description": "Superseding schema example", | ||
"$supersededBy": "1-0-1", | ||
"self": { | ||
"vendor": "com.acme", | ||
"name": "superseding_schema", | ||
"format": "jsonschema", | ||
"version": "1-0-0" | ||
}, | ||
"type": "object", | ||
"properties": { | ||
"field_a": { | ||
"type": "string" | ||
}, | ||
"field_b": { | ||
"type": "string" | ||
}, | ||
"field_c": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["field_a", "field_b"], | ||
"additionalProperties": false | ||
} |
27 changes: 27 additions & 0 deletions
27
...mon/src/test/resources/iglu-schemas/schemas/com.acme/superseding_example/jsonschema/1-0-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#", | ||
"description": "Superseding schema example", | ||
"self": { | ||
"vendor": "com.acme", | ||
"name": "superseding_schema", | ||
"format": "jsonschema", | ||
"version": "1-0-1" | ||
}, | ||
"type": "object", | ||
"properties": { | ||
"field_a": { | ||
"type": "string" | ||
}, | ||
"field_b": { | ||
"type": "string" | ||
}, | ||
"field_c": { | ||
"type": "string" | ||
}, | ||
"field_d": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["field_a", "field_b"], | ||
"additionalProperties": false | ||
} |
22 changes: 22 additions & 0 deletions
22
...mon/src/test/resources/iglu-schemas/schemas/com.acme/superseding_example/jsonschema/2-0-0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#", | ||
"description": "Superseding schema example", | ||
"$supersededBy": "2-0-1", | ||
"self": { | ||
"vendor": "com.acme", | ||
"name": "superseding_schema", | ||
"format": "jsonschema", | ||
"version": "2-0-0" | ||
}, | ||
"type": "object", | ||
"properties": { | ||
"field_e": { | ||
"type": "string" | ||
}, | ||
"field_f": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["field_e", "field_f"], | ||
"additionalProperties": false | ||
} |
24 changes: 24 additions & 0 deletions
24
...mon/src/test/resources/iglu-schemas/schemas/com.acme/superseding_example/jsonschema/2-0-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#", | ||
"description": "Superseding schema example", | ||
"self": { | ||
"vendor": "com.acme", | ||
"name": "superseding_schema", | ||
"format": "jsonschema", | ||
"version": "2-0-1" | ||
}, | ||
"type": "object", | ||
"properties": { | ||
"field_e": { | ||
"type": "string" | ||
}, | ||
"field_f": { | ||
"type": "string" | ||
}, | ||
"field_g": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["field_e", "field_f"], | ||
"additionalProperties": false | ||
} |
Oops, something went wrong.