@@ -4,14 +4,16 @@ import type { IFunctionResult, RulesetDefinition } from '@geonovum/standards-che
44import { oas3_0 } from './formats' ;
55import { truthy } from '@geonovum/standards-checker/spectral/functions' ;
66
7- export const OGC_API_PROCESSES_CORE_URI = 'http://www.opengis.net/spec/ogcapi-processes-1/1 .0/conf/core' ;
7+ export const OGC_API_PROCESSES_CORE_URI = 'http://www.opengis.net/spec/ogcapi-processes-1/2 .0/conf/core' ;
88
99export const OGC_API_PROCESSES_CORE_DOC_URI = 'https://docs.ogc.org/DRAFTS/18-062r3.html#req_core_' ;
1010
11+ // The v2.0 schemas are not yet published under https://schemas.opengis.net/ogcapi/processes/part1/2.0/
12+ // (18-062r3 is still a draft), so the `master` branch — which tracks the 2.0 revision — is the live source.
1113export const SCHEMAS_URI_PREFIX = 'https://raw.githubusercontent.com/opengeospatial/ogcapi-processes/master/openapi/schemas/' ;
1214
1315const processesCore : RulesetDefinition = {
14- documentationUrl : 'http://www.opengis.net/spec/ogcapi-processes-1/1 .0/req/core' ,
16+ documentationUrl : 'http://www.opengis.net/spec/ogcapi-processes-1/2 .0/req/core' ,
1517 description : 'OGC API - Processes - Part 1: Core - Requirements Class "Core"' ,
1618 formats : [ oas3_0 ] ,
1719 rules : {
@@ -167,7 +169,7 @@ const processesCore: RulesetDefinition = {
167169 function : truthy ,
168170 } ,
169171 } ,
170- '/req/core/process-exception/ no-such-process' : {
172+ '/req/core/process-exception- no-such-process' : {
171173 given : '$.paths[?(@property.match(/^\\/processes\\/[^/]+$/))].get.responses' ,
172174 message : 'If the operation is executed using an invalid process identifier, the response SHALL be HTTP status code `404`.' ,
173175 documentationUrl : OGC_API_PROCESSES_CORE_DOC_URI + 'process-exception-no-such-process' ,
@@ -401,6 +403,28 @@ const processesCore: RulesetDefinition = {
401403 function : truthy ,
402404 } ,
403405 } ,
406+ '/req/core/job-result-op-0th' : {
407+ given : '$.paths' ,
408+ message : 'The server SHALL support the HTTP GET operation at the path `/jobs/{jobID}/results/{outputID}/0`.' ,
409+ documentationUrl : OGC_API_PROCESSES_CORE_DOC_URI + 'job-result-op-0th' ,
410+ severity : 'error' ,
411+ then : {
412+ function : hasPathMatch ,
413+ functionOptions : {
414+ pattern : '^\\/jobs\\/[^/]+\\/results\\/[^/]+\\/0$' ,
415+ } ,
416+ } ,
417+ } ,
418+ '/req/core/job-result-op-0th#get' : {
419+ given : '$.paths[?(@property.match(/^\\/jobs\\/[^/]+\\/results\\/[^/]+\\/0$/))]' ,
420+ message : 'The server SHALL support the HTTP GET operation at the path `/jobs/{jobID}/results/{outputID}/0`.' ,
421+ documentationUrl : OGC_API_PROCESSES_CORE_DOC_URI + 'job-result-op-0th' ,
422+ severity : 'error' ,
423+ then : {
424+ field : 'get' ,
425+ function : truthy ,
426+ } ,
427+ } ,
404428 '/req/core/job-results-async-one' : {
405429 given : '$.paths[?(@property.match(/^\\/jobs\\/[^/]+\\/results\\/[^/]+$/))].get.responses' ,
406430 message : 'A successful retrieval of a single result SHALL be reported with HTTP status code `200`.' ,
@@ -430,10 +454,30 @@ const processesCore: RulesetDefinition = {
430454 } ,
431455 ] ,
432456 } ,
433- '/req/core/job-results-exception/ invalid-query-parameter-value' : {
457+ '/req/core/job-results-exception- invalid-query-parameter-value' : {
434458 given : '$.paths[?(@property.match(/^\\/jobs\\/[^/]+\\/results$/))].get.responses' ,
435459 message : 'If a query parameter has an invalid value, the response SHALL have HTTP status code `400`. {{error}}' ,
436- documentationUrl : OGC_API_PROCESSES_CORE_DOC_URI + 'job-results-exception-invalid-query-parameter-value' ,
460+ documentationUrl : OGC_API_PROCESSES_CORE_DOC_URI + 'job-results-exception_invalid-query-parameter-value' ,
461+ severity : 'error' ,
462+ then : [
463+ {
464+ field : '400' ,
465+ function : truthy ,
466+ } ,
467+ {
468+ field : '400' ,
469+ function : hasSchemaMatch ,
470+ functionOptions : {
471+ schemaUri : SCHEMAS_URI_PREFIX + 'common-core/exception.yaml' ,
472+ } ,
473+ } ,
474+ ] ,
475+ } ,
476+ '/req/core/job-results-exception-no-such-output' : {
477+ given : '$.paths[?(@property.match(/^\\/jobs\\/[^/]+\\/results$/))].get.responses' ,
478+ message :
479+ 'If the operation requests an output identifier that does not exist, the response SHALL have HTTP status code `400`. {{error}}' ,
480+ documentationUrl : OGC_API_PROCESSES_CORE_DOC_URI + 'job-results-exception-no-such-output' ,
437481 severity : 'error' ,
438482 then : [
439483 {
@@ -449,7 +493,7 @@ const processesCore: RulesetDefinition = {
449493 } ,
450494 ] ,
451495 } ,
452- '/req/core/job-results-exception/ no-such-job' : {
496+ '/req/core/job-results-exception- no-such-job' : {
453497 given : '$.paths[?(@property.match(/^\\/jobs\\/[^/]+\\/results$/))].get.responses' ,
454498 message : 'If the job identifier is invalid, the response SHALL have HTTP status code `404`. {{error}}' ,
455499 documentationUrl : OGC_API_PROCESSES_CORE_DOC_URI + 'job-results-exception-no-such-job' ,
@@ -468,10 +512,10 @@ const processesCore: RulesetDefinition = {
468512 } ,
469513 ] ,
470514 } ,
471- '/req/core/job-results-exception/ results-not-ready' : {
515+ '/req/core/job-results-exception- results-not-ready' : {
472516 given : '$.paths[?(@property.match(/^\\/jobs\\/[^/]+\\/results$/))].get.responses' ,
473517 message : 'If the job is still running, the response SHALL have HTTP status code `404`. {{error}}' ,
474- documentationUrl : OGC_API_PROCESSES_CORE_DOC_URI + 'job-results-exception-results -not-ready' ,
518+ documentationUrl : OGC_API_PROCESSES_CORE_DOC_URI + 'job-results-exception_results -not-ready' ,
475519 severity : 'error' ,
476520 then : [
477521 {
@@ -487,10 +531,10 @@ const processesCore: RulesetDefinition = {
487531 } ,
488532 ] ,
489533 } ,
490- '/req/core/job-results-exception/ results-not-available' : {
534+ '/req/core/job-results-exception- results-not-available' : {
491535 given : '$.paths[?(@property.match(/^\\/jobs\\/[^/]+\\/results$/))].get.responses' ,
492536 message : 'If no outputs are available, the response SHALL have HTTP status code `404`. {{error}}' ,
493- documentationUrl : OGC_API_PROCESSES_CORE_DOC_URI + 'job-results-exception-results -not-available' ,
537+ documentationUrl : OGC_API_PROCESSES_CORE_DOC_URI + 'job-results-exception_results -not-available' ,
494538 severity : 'error' ,
495539 then : [
496540 {
0 commit comments