From 2a00b83f2f109956160ba796b9269594b9ae6add Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan <10220473+jackdos@users.noreply.github.com> Date: Wed, 8 May 2024 11:32:18 +0100 Subject: [PATCH 1/8] issue-21 - Added clarifying documentation on offsets and limits --- api/par-api.yaml | 55 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/api/par-api.yaml b/api/par-api.yaml index 65b2555..71f31fd 100644 --- a/api/par-api.yaml +++ b/api/par-api.yaml @@ -122,14 +122,17 @@ paths: in: query description: Used for requesting paged responses, this defines the offset of the first Business Rule to return from the start of the list of all matching - Business Rules. + Business Rules. If not specified this defaults to 0. schema: type: integer default: 0 - name: limit in: query description: Used for requesting paged responses, this defines the maximum - number of Business Rules to return. + number of Business Rules to return. If not specified, all results will be returned. + To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 + and empty list of results will be returned along with standard details of how many + results actually matched. schema: type: integer default: 0 @@ -1054,14 +1057,17 @@ paths: in: query description: Used for requesting paged responses, this defines the offset of the first FileFormat to return from the start of the list of all matching - File Formats. + File Formats. If not specified this defaults to 0. schema: type: integer default: 0 - name: limit in: query description: Used for requesting paged responses, this defines the maximum - number of FileFormats to return. + number of FileFormats to return. If not specified, all results will be returned. + To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 + and empty list of results will be returned along with standard details of how many + results actually matched. schema: type: integer default: 0 @@ -1683,14 +1689,17 @@ paths: in: query description: Used for requesting paged responses, this defines the offset of the first Format Family to return from the start of the list of all matching - Format Families. + Format Families. If not specified this defaults to 0. schema: type: integer default: 0 - name: limit in: query description: Used for requesting paged responses, this defines the maximum - number of Format Families to return. + number of Format Families to return. If not specified, all results will be returned. + To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 + and empty list of results will be returned along with standard details of how many + results actually matched. schema: type: integer default: 0 @@ -2085,14 +2094,17 @@ paths: in: query description: Used for requesting paged responses, this defines the offset of the first Preservation Action Type to return from the start of the list - of all matching Preservation Action Types. + of all matching Preservation Action Types. If not specified this defaults to 0. schema: type: integer default: 0 - name: limit in: query description: Used for requesting paged responses, this defines the maximum - number of Preservation Action Types to return. + number of Preservation Action Types to return. If not specified, all results will be returned. + To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 + and empty list of results will be returned along with standard details of how many + results actually matched. schema: type: integer default: 0 @@ -2379,14 +2391,17 @@ paths: in: query description: Used for requesting paged responses, this defines the offset of the first Preservation Action to return from the start of the list of - all matching Preservation Actions. + all matching Preservation Actions. If not specified this defaults to 0. schema: type: integer default: 0 - name: limit in: query description: Used for requesting paged responses, this defines the maximum - number of Preservation Actions to return. + number of Preservation Actions to return. If not specified, all results will be returned. + To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 + and empty list of results will be returned along with standard details of how many + results actually matched. schema: type: integer default: 0 @@ -4108,14 +4123,17 @@ paths: in: query description: Used for requesting paged responses, this defines the offset of the first Property to return from the start of the list of all matching - Properties. + Properties. If not specified this defaults to 0. schema: type: integer default: 0 - name: limit in: query description: Used for requesting paged responses, this defines the maximum - number of Properties to return. + number of Properties to return. If not specified, all results will be returned. + To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 + and empty list of results will be returned along with standard details of how many + results actually matched. schema: type: integer default: 0 @@ -4421,14 +4439,17 @@ paths: in: query description: Used for requesting paged responses, this defines the offset of the first RepresentationFormat to return from the start of the list of - all matching Representation Formats. + all matching Representation Formats. If not specified this defaults to 0. schema: type: integer default: 0 - name: limit in: query description: Used for requesting paged responses, this defines the maximum - number of RepresentationFormats to return. + number of RepresentationFormats to return. If not specified, all results will be returned. + To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 + and empty list of results will be returned along with standard details of how many + results actually matched. schema: type: integer default: 0 @@ -4754,13 +4775,17 @@ paths: in: query description: Used for requesting paged responses, this defines the offset of the first Tool to return from the start of the list of all matching Tools. + If not specified this defaults to 0. schema: type: integer default: 0 - name: limit in: query description: Used for requesting paged responses, this defines the maximum - number of Tools to return. + number of Tools to return. If not specified, all results will be returned. + To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 + and empty list of results will be returned along with standard details of how many + results actually matched. schema: type: integer default: 0 From b5e8d00d15113c7c2d191f2b4c05c53715fa5338 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan <10220473+jackdos@users.noreply.github.com> Date: Wed, 8 May 2024 14:01:17 +0100 Subject: [PATCH 2/8] issue-21 - Added result list object type and added to test --- schema/result-list.json | 78 +++++++++++++++++++++++++++++++++++++++++ testing/test_main.py | 56 ++++++++++++++++++++--------- 2 files changed, 117 insertions(+), 17 deletions(-) create mode 100644 schema/result-list.json diff --git a/schema/result-list.json b/schema/result-list.json new file mode 100644 index 0000000..868088c --- /dev/null +++ b/schema/result-list.json @@ -0,0 +1,78 @@ +{ + "$id": "http://www.parcore.org/schema/result-list.json/#", + "$schema": "http://json-schema.org/draft-06/schema#", + "additionalProperties": false, + "definitions": { + "paging": { + "additionalProperties": false, + "description": "Details of the paging of this request. This contains details of the number of results returned in this page (i.e. with the specified offset and limit) by this query, the overall number of results matching the query (without paging restrictions) and enough information for the client to construct the request for the next page of results, this includes the next page URL and details of the parameters passed in the headers.", + "properties": { + "nextPage": { + "type": "string" + }, + "parameters": { + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "type": "array" + }, + "returnedResults": { + "type": "integer" + }, + "totalResults": { + "type": "integer" + } + }, + "title": "Paging Details", + "type": "object" + }, + "query": { + "additionalProperties": false, + "description": "Details of the query submitted that can be used to replay the request, this includes the request url and details of the parameters passed in the headers.", + "properties": { + "parameters": { + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "type": "array" + }, + "url": { + "type": "string" + } + } + } + }, + "description": "This is a wrapper object used by the PAR API to provide a standard return type for all listing endpoints.", + "properties": { + "apiVersion": { + "type": "string" + }, + "paging": { + "$ref": "http://www.parcore.org/schema/result-list.json/#/definitions/paging" + }, + "query": { + "$ref": "http://www.parcore.org/schema/result-list.json/#/definitions/query" + } + }, + "patternProperties": { + "businessRules|fileFormats|formatFamilies|preservationActionTypes|preservationActions|parProperties|representationFormats|tools": { + "items": { + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "apiVersion", + "paging", + "query" + ], + "title": "Representation Format", + "type": "object" +} \ No newline at end of file diff --git a/testing/test_main.py b/testing/test_main.py index fb99241..1fba34f 100644 --- a/testing/test_main.py +++ b/testing/test_main.py @@ -32,23 +32,27 @@ class AbstractSchemaValidatorTest(object): ), ( "http://www.parcore.org/schema/business-rule.json/#", - "schema/business-rule.json" + get_schema_path("business-rule.json") ), ( "http://www.parcore.org/schema/preservation-action-type.json/#", - "schema/preservation-action-type.json" + get_schema_path("preservation-action-type.json") ), ( "http://www.parcore.org/schema/types.json/#", - "schema/types.json" + get_schema_path("types.json") ), ( "http://www.parcore.org/schema/par-property.json/#", - "schema/par-property.json" + get_schema_path("par-property.json") ), ( "http://www.parcore.org/schema/representation-format.json/#", - "schema/representation-format.json" + get_schema_path("representation-format.json") + ), + ( + "http://www.parcore.org/schema/result-list.json/#", + get_schema_path("result-list.json") ) ] @@ -90,7 +94,7 @@ def get_json_schema_file_name(self): return 'schema/format.json' def test_validation(self): - """ Test the example.""" + """ Test the example. """ self.validate_json('examples/fmt-43.json') @@ -100,7 +104,7 @@ def get_json_schema_file_name(self): return 'schema/preservation-action.json' def test_validation(self): - """ Test the example.""" + """ Test the example. """ self.validate_json('examples/md5check1.json') class PreservationActionTest2(AbstractSchemaValidatorTest, TestCase): @@ -109,7 +113,7 @@ def get_json_schema_file_name(self): return 'schema/preservation-action.json' def test_validation(self): - """ Test the example.""" + """ Test the example. """ self.validate_json('examples/md5check2.json') class PreservationActionTest3(AbstractSchemaValidatorTest, TestCase): @@ -127,7 +131,7 @@ def get_json_schema_file_name(self): return 'schema/tool.json' def test_validation(self): - """ Test the example.""" + """ Test the example. """ self.validate_json('examples/md5sum.json') @@ -137,7 +141,7 @@ def get_json_schema_file_name(self): return 'schema/tool.json' def test_validation(self): - """ Test the example.""" + """ Test the example. """ self.validate_json('examples/ffmpeg.json') @@ -147,7 +151,7 @@ def get_json_schema_file_name(self): return 'schema/business-rule.json' def test_validation(self): - """ Test the example.""" + """ Test the example. """ self.validate_json('examples/br-1.json') class BusinessRuleTest2(AbstractSchemaValidatorTest, TestCase): @@ -156,7 +160,7 @@ def get_json_schema_file_name(self): return 'schema/business-rule.json' def test_validation(self): - """ Test the example.""" + """ Test the example. """ self.validate_json('examples/br-2.json') class BusinessRuleTest3(AbstractSchemaValidatorTest, TestCase): @@ -165,7 +169,7 @@ def get_json_schema_file_name(self): return 'schema/business-rule.json' def test_validation(self): - """ Test the example.""" + """ Test the example. """ self.validate_json('examples/br-3.json') @@ -175,7 +179,7 @@ def get_json_schema_file_name(self): return 'schema/par-property.json' def test_validation(self): - """ Test the example.""" + """ Test the example. """ self.validate_json('examples/md5prop.json') @@ -185,7 +189,7 @@ def get_json_schema_file_name(self): return 'schema/par-property.json' def test_validation(self): - """ Test the example.""" + """ Test the example. """ self.validate_json('examples/passfailprop.json') @@ -195,7 +199,7 @@ def get_json_schema_file_name(self): return 'schema/par-property.json' def test_validation(self): - """ Test the example.""" + """ Test the example. """ self.validate_json('examples/aspectratioprop.json') @@ -205,7 +209,7 @@ def get_json_schema_file_name(self): return 'schema/par-property.json' def test_validation(self): - """ Test the example.""" + """ Test the example. """ self.validate_json('examples/ebucorewidthprop.json') class RepresentationFormatTest(AbstractSchemaValidatorTest, TestCase): @@ -216,3 +220,21 @@ def get_json_schema_file_name(self): def test_validation(self): """ Test the example. """ self.validate_json('examples/repfmt-tweet.json') + +class ResultListBusinessRulesTest(AbstractSchemaValidatorTest, TestCase): + """Test for Result List Business Rules example. """ + def get_json_schema_file_name(self): + return 'schema/result-list.json' + + def test_validation(self): + """ Test the Business Rules example. """ + self.validate_json('examples/result-list-business-rules.json') + +class ResultListBusinessRulesTest(AbstractSchemaValidatorTest, TestCase): + """Test for Result List Tools example. """ + def get_json_schema_file_name(self): + return 'schema/result-list.json' + + def test_validation(self): + """ Test the Tools example. """ + self.validate_json('examples/result-list-tools.json') From c1054225ee9de667144160c1b853b8878b27ca96 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan <10220473+jackdos@users.noreply.github.com> Date: Wed, 8 May 2024 14:01:58 +0100 Subject: [PATCH 3/8] issue-21 - added new commits from examples --- examples | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples b/examples index 0ea43f0..3ddd844 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 0ea43f0a0484e02615515186d9e976d5f0ddf8ca +Subproject commit 3ddd8440eae6fa28895edaffe3590d4b1c8ed2fc From f0fccf233432ff287f0866af540c7d11d7b269cf Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan <10220473+jackdos@users.noreply.github.com> Date: Wed, 8 May 2024 15:09:50 +0100 Subject: [PATCH 4/8] issue-21 - modified format of parameters to be a single map, added documentation to api yaml --- api/par-api.yaml | 158 ++++++++++++++++++++++++++++++++++++++-- examples | 2 +- schema/result-list.json | 22 ++---- 3 files changed, 159 insertions(+), 23 deletions(-) diff --git a/api/par-api.yaml b/api/par-api.yaml index 71f31fd..0099710 100644 --- a/api/par-api.yaml +++ b/api/par-api.yaml @@ -148,9 +148,24 @@ paths: content: application/json;charset=UTF-8: schema: - $ref: '#/components/schemas/BusinessRules' + $ref: '#/components/schemas/ListResult' examples: |- { + "apiVersion": "1.3", + "paging": { + "nextPage": "https://parcore.org/par/business-rules?offset=2&limit=2", + "parameters": { + "preservation-action-type-name": "mee" + }, + "returnedResults": 2, + "totalResults": 15 + }, + "query": { + "url": "https://parcore.org/par/business-rules?offset=0&limit=2", + "parameters": { + "preservation-action-type-name": "mee" + } + }, "businessRules" : [ { "id" : { "guid" : "cb2bea88-8006-58fa-a395-dcf0d76a32ee", @@ -1083,9 +1098,20 @@ paths: content: application/json;charset=UTF-8: schema: - $ref: '#/components/schemas/FileFormats' + $ref: '#/components/schemas/ListResult' examples: |- { + "apiVersion": "1.3", + "paging": { + "nextPage": "https://parcore.org/par/file-formats?offset=1&limit=1", + "parameters": {}, + "returnedResults": 1, + "totalResults": 1594 + }, + "query": { + "url": "https://parcore.org/par/file-formats?offset=0&limit=1", + "parameters": {} + }, "fileFormats" : [ { "description" : "This is an outline record only, and requires further details, research or authentication to provide information that will enable users to further understand the format and to assess digital preservation risks associated with it if appropriate.", "externalSignatures" : [ { @@ -1715,9 +1741,24 @@ paths: content: application/json;charset=UTF-8: schema: - $ref: '#/components/schemas/FormatFamilies' + $ref: '#/components/schemas/ListResult' examples: |- { + "apiVersion": "1.3", + "paging": { + "nextPage": "https://parcore.org/par/format-families?offset=2&limit=2", + "parameters": { + "format-family-name": "matroska,container" + }, + "returnedResults": 2, + "totalResults": 2 + }, + "query": { + "url": "https://parcore.org/par/format-families?offset=0&limit=2", + "parameters": { + "format-family-name": "matroska,container" + } + }, "formatFamilies" : [ { "id" : { "guid" : "d7df91be-c3d1-51f2-8432-2d9ac63c43e7", @@ -2120,9 +2161,20 @@ paths: content: application/json;charset=UTF-8: schema: - $ref: '#/components/schemas/PreservationActionTypes' + $ref: '#/components/schemas/ListResult' examples: |- { + "apiVersion": "1.3", + "paging": { + "nextPage": "https://parcore.org/par/preservation-action-types?offset=2&limit=2", + "parameters": {}, + "returnedResults": 2, + "totalResults": 10 + }, + "query": { + "url": "https://parcore.org/par/preservation-action-types?offset=0&limit=2", + "parameters": {} + }, "preservationActionTypes" : [ { "id" : { "guid" : "5f0fbe10-deec-5965-abbb-2474a857a39f", @@ -2417,9 +2469,24 @@ paths: content: application/json;charset=UTF-8: schema: - $ref: '#/components/schemas/PreservationActions' + $ref: '#/components/schemas/ListResult' examples: |- { + "apiVersion": "1.3", + "paging": { + "nextPage": "https://parcore.org/par/preservation-actions?offset=2&limit=2", + "parameters": { + "preservation-action-type-name": "mee,mig" + }, + "returnedResults": 2, + "totalResults": 50 + }, + "query": { + "url": "https://parcore.org/par/preservation-actions?offset=0&limit=2", + "parameters": { + "preservation-action-type-name": "mee,mig" + } + }, "preservationActions" : [ { "description" : "Property Extraction of video files using MediaInfo CLI and EBUCore Metadata", "example" : "mediainfo --Output=EBUCore ${inputfile}", @@ -4149,9 +4216,20 @@ paths: content: application/json;charset=UTF-8: schema: - $ref: '#/components/schemas/ParProperties' + $ref: '#/components/schemas/ListResult' examples: |- { + "apiVersion": "1.3", + "paging": { + "nextPage": "https://parcore.org/par/properties?offset=2&limit=2", + "parameters": {}, + "returnedResults": 2, + "totalResults": 2 + }, + "query": { + "url": "https://parcore.org/par/properties?offset=0&limit=2", + "parameters": {} + }, "parProperties" : [ { "id" : { "guid" : "e21641c7-ea11-5f10-9a00-64a7b62d2b95", @@ -4465,9 +4543,26 @@ paths: content: application/json;charset=UTF-8: schema: - $ref: '#/components/schemas/RepresentationFormats' + $ref: '#/components/schemas/ListResult' examples: |- { + "apiVersion": "1.3", + "paging": { + "nextPage": "https://parcore.org/par/representation-formats?offset=3&limit=3", + "parameters": { + "file-format-name": "fmt/199", + "format-family-name": "email" + }, + "returnedResults": 2, + "totalResults": 2 + }, + "query": { + "url": "https://parcore.org/par/representation-formats?offset=0&limit=3", + "parameters": { + "file-format-name": "fmt/199", + "format-family-name": "email" + }, + }, "representationFormats" : [{ "id": { "guid": "c9828123-71cc-57d0-97e2-489c71d457e0", @@ -4801,9 +4896,20 @@ paths: content: application/json;charset=UTF-8: schema: - $ref: '#/components/schemas/Tools' + $ref: '#/components/schemas/ListResult' examples: |- { + "apiVersion": "1.3", + "paging": { + "nextPage": "https://parcore.org/par/tools?offset=2&limit=2", + "parameters": {}, + "returnedResults": 2, + "totalResults": 20 + }, + "query": { + "url": "https://parcore.org/par/tools?offset=0&limit=2", + "parameters": {} + }, "tools" : [ { "id" : { "guid" : "8fb7cc10-0c3f-56da-8be6-1d892f36abc3", @@ -5375,6 +5481,20 @@ components: type: string signatureNote: type: string + ListResult: + type: object + properties: + apiVersion: + type: string + paging: + $ref: '#/components/schemas/Paging' + query: + $ref: '#/components/schemas/Query' + patternProperties: + businessRules|fileFormats|formatFamilies|preservationActionTypes|preservationActions|parProperties|representationFormats|tools: + type: array + items: + type: object OutputFile: type: object properties: @@ -5408,6 +5528,19 @@ components: type: string value: type: string + Paging: + type: object + properties: + nextPage: + type: string + parameters: + type: object + additionalProperties: + type: string + returnedResults: + type: integer + totalResults: + type: integer ParFile: type: object properties: @@ -5559,6 +5692,15 @@ components: type: string publisherName: type: string + Query: + type: object + properties: + parameters: + type: object + additionalProperties: + type: string + url: + type: string RegistryVersionInformation: type: object properties: diff --git a/examples b/examples index 3ddd844..a5a9d45 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 3ddd8440eae6fa28895edaffe3590d4b1c8ed2fc +Subproject commit a5a9d4573be8b3e7780b0adbc672fda53938cc13 diff --git a/schema/result-list.json b/schema/result-list.json index 868088c..c4e23e1 100644 --- a/schema/result-list.json +++ b/schema/result-list.json @@ -11,13 +11,10 @@ "type": "string" }, "parameters": { - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "type": "array" + "type": "object", + "additionalProperties": { + "type": "string" + } }, "returnedResults": { "type": "integer" @@ -34,13 +31,10 @@ "description": "Details of the query submitted that can be used to replay the request, this includes the request url and details of the parameters passed in the headers.", "properties": { "parameters": { - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "type": "array" + "type": "object", + "additionalProperties": { + "type": "string" + } }, "url": { "type": "string" From 3ec133c71b4e51d8125bc4147f90256565737a1f Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan <10220473+jackdos@users.noreply.github.com> Date: Wed, 8 May 2024 15:42:54 +0100 Subject: [PATCH 5/8] issue-21 - fixed python test function name --- testing/test_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test_main.py b/testing/test_main.py index 1fba34f..818b013 100644 --- a/testing/test_main.py +++ b/testing/test_main.py @@ -230,7 +230,7 @@ def test_validation(self): """ Test the Business Rules example. """ self.validate_json('examples/result-list-business-rules.json') -class ResultListBusinessRulesTest(AbstractSchemaValidatorTest, TestCase): +class ResultListToolsTest(AbstractSchemaValidatorTest, TestCase): """Test for Result List Tools example. """ def get_json_schema_file_name(self): return 'schema/result-list.json' From 2c4c69170459babb8bab17be738f2b687b941f19 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan <10220473+jackdos@users.noreply.github.com> Date: Wed, 8 May 2024 15:49:27 +0100 Subject: [PATCH 6/8] issue-21 - fixed EOF line --- schema/result-list.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/result-list.json b/schema/result-list.json index c4e23e1..5ae28da 100644 --- a/schema/result-list.json +++ b/schema/result-list.json @@ -69,4 +69,4 @@ ], "title": "Representation Format", "type": "object" -} \ No newline at end of file +} From 779b23a95abf4a49353a09c1b5f9c9096d3b73c5 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan <10220473+jackdos@users.noreply.github.com> Date: Wed, 8 May 2024 16:06:52 +0100 Subject: [PATCH 7/8] issue-21 - specified python3 as pre-commit language requirement, fixed pretty formatting on result-list.json --- .pre-commit-config.yaml | 10 ++++++++++ schema/result-list.json | 24 ++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cf11443..14b6db8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,14 +3,24 @@ repos: rev: v1.4.0 hooks: - id: check-byte-order-marker + language_version: python3 - id: check-case-conflict + language_version: python3 - id: check-docstring-first + language_version: python3 - id: check-json + language_version: python3 - id: check-yaml + language_version: python3 - id: end-of-file-fixer exclude: ^.*\.(svg)$ + language_version: python3 - id: forbid-new-submodules + language_version: python3 - id: name-tests-test + language_version: python3 - id: requirements-txt-fixer + language_version: python3 - id: pretty-format-json args: [ --autofix, --indent=2] + language_version: python3 diff --git a/schema/result-list.json b/schema/result-list.json index 5ae28da..442c687 100644 --- a/schema/result-list.json +++ b/schema/result-list.json @@ -11,10 +11,10 @@ "type": "string" }, "parameters": { - "type": "object", "additionalProperties": { "type": "string" - } + }, + "type": "object" }, "returnedResults": { "type": "integer" @@ -31,10 +31,10 @@ "description": "Details of the query submitted that can be used to replay the request, this includes the request url and details of the parameters passed in the headers.", "properties": { "parameters": { - "type": "object", "additionalProperties": { "type": "string" - } + }, + "type": "object" }, "url": { "type": "string" @@ -43,6 +43,14 @@ } }, "description": "This is a wrapper object used by the PAR API to provide a standard return type for all listing endpoints.", + "patternProperties": { + "businessRules|fileFormats|formatFamilies|preservationActionTypes|preservationActions|parProperties|representationFormats|tools": { + "items": { + "type": "object" + }, + "type": "array" + } + }, "properties": { "apiVersion": { "type": "string" @@ -54,14 +62,6 @@ "$ref": "http://www.parcore.org/schema/result-list.json/#/definitions/query" } }, - "patternProperties": { - "businessRules|fileFormats|formatFamilies|preservationActionTypes|preservationActions|parProperties|representationFormats|tools": { - "items": { - "type": "object" - }, - "type": "array" - } - }, "required": [ "apiVersion", "paging", From 4a22640e1b444e5eb501cad48f5fb570d84a3ef3 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan <10220473+jackdos@users.noreply.github.com> Date: Fri, 10 May 2024 10:14:26 +0100 Subject: [PATCH 8/8] issue-21 - post-review fix to documentation wording, fixed several typos --- api/par-api.yaml | 128 ++++++++++++++++++++++------------------------- 1 file changed, 60 insertions(+), 68 deletions(-) diff --git a/api/par-api.yaml b/api/par-api.yaml index 0099710..c960071 100644 --- a/api/par-api.yaml +++ b/api/par-api.yaml @@ -131,8 +131,7 @@ paths: description: Used for requesting paged responses, this defines the maximum number of Business Rules to return. If not specified, all results will be returned. To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 - and empty list of results will be returned along with standard details of how many - results actually matched. + an empty list of results will be returned along with a count of matching results. schema: type: integer default: 0 @@ -144,7 +143,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -560,7 +559,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -707,7 +706,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -835,7 +834,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 501: $ref: '#/components/responses/NotImplemented' @@ -872,7 +871,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -1024,7 +1023,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 401: $ref: '#/components/responses/Unauthorized' @@ -1081,8 +1080,7 @@ paths: description: Used for requesting paged responses, this defines the maximum number of FileFormats to return. If not specified, all results will be returned. To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 - and empty list of results will be returned along with standard details of how many - results actually matched. + an empty list of results will be returned along with a count of matching results. schema: type: integer default: 0 @@ -1094,7 +1092,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -1256,7 +1254,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -1381,7 +1379,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -1487,7 +1485,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 501: $ref: '#/components/responses/NotImplemented' @@ -1524,7 +1522,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -1654,7 +1652,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 401: $ref: '#/components/responses/Unauthorized' @@ -1724,8 +1722,7 @@ paths: description: Used for requesting paged responses, this defines the maximum number of Format Families to return. If not specified, all results will be returned. To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 - and empty list of results will be returned along with standard details of how many - results actually matched. + an empty list of results will be returned along with a count of matching results. schema: type: integer default: 0 @@ -1737,7 +1734,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -1878,7 +1875,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -1940,7 +1937,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -1983,7 +1980,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 501: $ref: '#/components/responses/NotImplemented' @@ -2020,7 +2017,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -2087,7 +2084,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 401: $ref: '#/components/responses/Unauthorized' @@ -2144,8 +2141,7 @@ paths: description: Used for requesting paged responses, this defines the maximum number of Preservation Action Types to return. If not specified, all results will be returned. To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 - and empty list of results will be returned along with standard details of how many - results actually matched. + an empty list of results will be returned along with a count of matching results. schema: type: integer default: 0 @@ -2157,7 +2153,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -2221,7 +2217,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -2263,7 +2259,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -2285,7 +2281,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 501: $ref: '#/components/responses/NotImplemented' @@ -2322,7 +2318,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -2369,7 +2365,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 401: $ref: '#/components/responses/Unauthorized' @@ -2452,8 +2448,7 @@ paths: description: Used for requesting paged responses, this defines the maximum number of Preservation Actions to return. If not specified, all results will be returned. To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 - and empty list of results will be returned along with standard details of how many - results actually matched. + an empty list of results will be returned along with a count of matching results. schema: type: integer default: 0 @@ -2465,7 +2460,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -3231,7 +3226,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -3528,7 +3523,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -3805,7 +3800,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 501: $ref: '#/components/responses/NotImplemented' @@ -3842,7 +3837,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -4144,7 +4139,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 401: $ref: '#/components/responses/Unauthorized' @@ -4199,8 +4194,7 @@ paths: description: Used for requesting paged responses, this defines the maximum number of Properties to return. If not specified, all results will be returned. To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 - and empty list of results will be returned along with standard details of how many - results actually matched. + an empty list of results will be returned along with a count of matching results. schema: type: integer default: 0 @@ -4212,7 +4206,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -4279,7 +4273,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -4322,7 +4316,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -4346,7 +4340,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 501: $ref: '#/components/responses/NotImplemented' @@ -4383,7 +4377,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -4431,7 +4425,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 401: $ref: '#/components/responses/Unauthorized' @@ -4443,7 +4437,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 501: $ref: '#/components/responses/NotImplemented' @@ -4526,8 +4520,7 @@ paths: description: Used for requesting paged responses, this defines the maximum number of RepresentationFormats to return. If not specified, all results will be returned. To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 - and empty list of results will be returned along with standard details of how many - results actually matched. + an empty list of results will be returned along with a count of matching results. schema: type: integer default: 0 @@ -4539,7 +4532,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -4672,7 +4665,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -4706,7 +4699,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -4748,7 +4741,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 501: $ref: '#/components/responses/NotImplemented' @@ -4785,7 +4778,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -4824,7 +4817,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 401: $ref: '#/components/responses/Unauthorized' @@ -4879,8 +4872,7 @@ paths: description: Used for requesting paged responses, this defines the maximum number of Tools to return. If not specified, all results will be returned. To explicitly request all results, set to a value < 0 (e.g. limit=-1). If set to 0 - and empty list of results will be returned along with standard details of how many - results actually matched. + an empty list of results will be returned along with a count of matching results. schema: type: integer default: 0 @@ -4892,7 +4884,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -4963,7 +4955,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -5008,7 +5000,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -5034,7 +5026,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 501: $ref: '#/components/responses/NotImplemented' @@ -5071,7 +5063,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: application/json;charset=UTF-8: schema: @@ -5121,7 +5113,7 @@ paths: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} 401: $ref: '#/components/responses/Unauthorized' @@ -5138,7 +5130,7 @@ components: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} Unauthorized: description: If no Authorization header has been supplied @@ -5147,7 +5139,7 @@ components: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} Forbidden: description: If the supplied Authorization header does not reference a user @@ -5157,7 +5149,7 @@ components: required: true schema: type: string - description: The default version of the PAR API supported by this enpoint. + description: The default version of the PAR API supported by this endpoint. content: {} schemas: Action: