-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For records, check that ocids are unique, not whole records
Additionally, for the case where ids/ocids are missing, we fallback to the message "Array has non-unique elements" This ensures we don't get a block of python repr data in the error message: OpenDataServices/cove#1220 There's also been a change of case from "Non-unique ID Values" to "Non-unique id values".
- Loading branch information
Showing
9 changed files
with
576 additions
and
136 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
17 changes: 17 additions & 0 deletions
17
tests/lib/fixtures/common/records_no_validation_errors.json
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,17 @@ | ||
{ | ||
"version": "1.1", | ||
"publishedDate": "2019-09-18T17:56:21.078Z", | ||
"publisher": { | ||
"name": "A Publisher Name" | ||
}, | ||
"uri": "http://example.org", | ||
"records": [ | ||
{ | ||
"ocid": "EXAMPLE-1", | ||
"releases": [{ | ||
"url": "http://example.org/", | ||
"date": "2019-09-18T17:56:21.078Z" | ||
}] | ||
} | ||
] | ||
} |
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,45 @@ | ||
{ | ||
"version": "1.1", | ||
"publishedDate": "2019-09-18T17:56:21.078Z", | ||
"publisher": { | ||
"name": "A Publisher Name" | ||
}, | ||
"uri": "http://example.org", | ||
"records": [ | ||
{ | ||
"ocid": "EXAMPLE-1", | ||
"releases": [{ | ||
"url": "http://example.org/", | ||
"date": "2019-09-18T17:56:21.078Z" | ||
}] | ||
}, | ||
{ | ||
"ocid": "EXAMPLE-1", | ||
"releases": [{ | ||
"url": "http://example.org/", | ||
"date": "2019-09-18T17:56:21.078Z" | ||
}] | ||
}, | ||
{ | ||
"ocid": "EXAMPLE-2", | ||
"releases": [{ | ||
"url": "http://example.org/", | ||
"date": "2019-09-18T17:56:21.078Z" | ||
}] | ||
}, | ||
{ | ||
"ocid": "EXAMPLE-2", | ||
"releases": [{ | ||
"url": "http://example.org/", | ||
"date": "2019-09-18T17:56:21.078Z" | ||
}] | ||
}, | ||
{ | ||
"ocid": "EXAMPLE-2", | ||
"releases": [{ | ||
"url": "http://example.org/different_url", | ||
"date": "2019-09-18T17:56:21.078Z" | ||
}] | ||
} | ||
] | ||
} |
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 @@ | ||
{ | ||
"version": "1.1", | ||
"publishedDate": "2019-09-18T17:56:21.078Z", | ||
"publisher": { | ||
"name": "A Publisher Name" | ||
}, | ||
"uri": "http://example.org", | ||
"records": [ | ||
{ | ||
"releases": [{ | ||
"url": "http://example.org/", | ||
"date": "2019-09-18T17:56:21.078Z" | ||
}] | ||
}, | ||
{ | ||
"releases": [{ | ||
"url": "http://example.org/", | ||
"date": "2019-09-18T17:56:21.078Z" | ||
}] | ||
} | ||
] | ||
} |
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,111 @@ | ||
{ | ||
"id": "https://standard.open-contracting.org/schema/1__1__4/release-package-schema.json", | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "Schema for an Open Contracting Release Package", | ||
"description": "The release package contains a list of releases along with some publishing metadata.", | ||
"type": "object", | ||
"required": [ | ||
"uri", | ||
"publisher", | ||
"publishedDate", | ||
"releases", | ||
"version" | ||
], | ||
"properties": { | ||
"uri": { | ||
"title": "Package identifier", | ||
"description": "The URI of this package that identifies it uniquely in the world. Recommended practice is to use a dereferenceable URI, where a persistent copy of this package is available.", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"version": { | ||
"title": "OCDS schema version", | ||
"description": "The version of the OCDS schema used in this package, expressed as major.minor For example: 1.0 or 1.1", | ||
"type": "string", | ||
"pattern": "^(\\d+\\.)(\\d+)$" | ||
}, | ||
"extensions": { | ||
"title": "OCDS extensions", | ||
"description": "An array of OCDS extensions used in this package, in which each array item is the URL of an extension.json file.", | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"format": "uri" | ||
} | ||
}, | ||
"publishedDate": { | ||
"title": "Published date", | ||
"description": "The date that this package was published. If this package is generated 'on demand', this date should reflect the date of the last change to the underlying contents of the package.", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"releases": { | ||
"title": "Releases", | ||
"description": "An array of one or more OCDS releases.", | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { | ||
"$ref": "https://standard.open-contracting.org/schema/1__1__4/release-schema.json" | ||
}, | ||
"uniqueItems": true | ||
}, | ||
"publisher": { | ||
"title": "Publisher", | ||
"description": "Information to uniquely identify the publisher of this package.", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "Name", | ||
"description": "The name of the organization or department responsible for publishing this data.", | ||
"type": "string" | ||
}, | ||
"scheme": { | ||
"title": "Scheme", | ||
"description": "The scheme that holds the unique identifiers used to identify the item being identified.", | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
}, | ||
"uid": { | ||
"title": "uid", | ||
"description": "The unique ID for this entity under the given ID scheme.", | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
}, | ||
"uri": { | ||
"title": "URI", | ||
"description": "A URI to identify the publisher.", | ||
"type": [ | ||
"string", | ||
"null" | ||
], | ||
"format": "uri" | ||
} | ||
}, | ||
"required": [ | ||
"name" | ||
] | ||
}, | ||
"license": { | ||
"title": "License", | ||
"description": "A link to the license that applies to the data in this package. A Public Domain Dedication or [Open Definition Conformant](http://opendefinition.org/licenses/) license is recommended. The canonical URI of the license should be used. Documents linked from this file may be under other license conditions.", | ||
"type": [ | ||
"string", | ||
"null" | ||
], | ||
"format": "uri" | ||
}, | ||
"publicationPolicy": { | ||
"title": "Publication policy", | ||
"description": "A link to a document describing the publishers [publication policy](https://standard.open-contracting.org/1.1/en/implementation/publication_policy/).", | ||
"type": [ | ||
"string", | ||
"null" | ||
], | ||
"format": "uri" | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/lib/fixtures/common/releases_no_validation_errors.json
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,17 @@ | ||
{ | ||
"version": "1.1", | ||
"publishedDate": "2019-09-18T17:56:21.078Z", | ||
"publisher": { | ||
"name": "A Publisher Name" | ||
}, | ||
"uri": "http://example.org", | ||
"releases": [ | ||
{ | ||
"id": "EXAMPLE-1-1", | ||
"ocid": "EXAMPLE-1", | ||
"date": "2019-09-18T17:56:21.078Z", | ||
"initiationType": "tender", | ||
"tag": ["planning"] | ||
} | ||
] | ||
} |
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,45 @@ | ||
{ | ||
"version": "1.1", | ||
"publishedDate": "2019-09-18T17:56:21.078Z", | ||
"publisher": { | ||
"name": "A Publisher Name" | ||
}, | ||
"uri": "http://example.org", | ||
"releases": [ | ||
{ | ||
"id": "EXAMPLE-1-1", | ||
"ocid": "EXAMPLE-1", | ||
"date": "2019-09-18T17:56:21.078Z", | ||
"initiationType": "tender", | ||
"tag": ["planning"] | ||
}, | ||
{ | ||
"id": "EXAMPLE-1-1", | ||
"ocid": "EXAMPLE-1", | ||
"date": "2019-09-18T17:56:21.078Z", | ||
"initiationType": "tender", | ||
"tag": ["planning"] | ||
}, | ||
{ | ||
"id": "EXAMPLE-1-2", | ||
"ocid": "EXAMPLE-1", | ||
"date": "2019-09-18T17:56:21.078Z", | ||
"initiationType": "tender", | ||
"tag": ["planning"] | ||
}, | ||
{ | ||
"id": "EXAMPLE-1-2", | ||
"ocid": "EXAMPLE-1", | ||
"date": "2019-09-18T17:56:21.078Z", | ||
"initiationType": "tender", | ||
"tag": ["planning"] | ||
}, | ||
{ | ||
"id": "EXAMPLE-1-2", | ||
"ocid": "EXAMPLE-1", | ||
"date": "1999-09-18T17:56:21.078Z", | ||
"initiationType": "tender", | ||
"tag": ["planning"] | ||
} | ||
] | ||
} |
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 @@ | ||
{ | ||
"version": "1.1", | ||
"publishedDate": "2019-09-18T17:56:21.078Z", | ||
"publisher": { | ||
"name": "A Publisher Name" | ||
}, | ||
"uri": "http://example.org", | ||
"releases": [ | ||
{ | ||
"ocid": "EXAMPLE-1", | ||
"date": "2019-09-18T17:56:21.078Z", | ||
"initiationType": "tender", | ||
"tag": ["planning"] | ||
}, | ||
{ | ||
"ocid": "EXAMPLE-1", | ||
"date": "2019-09-18T17:56:21.078Z", | ||
"initiationType": "tender", | ||
"tag": ["planning"] | ||
} | ||
] | ||
} |
Oops, something went wrong.