conformance_urls = [
"http://www.opengis.net/spec/ogcapi-common-1/1.0/conf/core",
"http://www.opengis.net/spec/ogcapi-common-2/1.0/conf/collections",
"http://www.opengis.net/spec/ogcapi-edr-1/1.1/conf/core", # Assume this will be changed to edr_version
]
openapi_conformance_urls = [
"http://www.opengis.net/spec/ogcapi-edr-1/1.1/req/oas30", # Assume this will be changed to oas31
"http://www.opengis.net/spec/ogcapi-edr-1/1.2/req/oas31",
]
...
def requirementA2_2_A5(jsondata: dict) -> tuple[bool, str]:
OGC API - Environmental Data Retrieval Standard
Version: 1.2
Requirement Annex A2.2 A5
Check if the conformance page contains the required EDR classes.
jsondata should be the "conformsTo"-part of the conformance page.
spec_url = f"{edr_root_url}#req_core_conformance"
if "conformsTo" not in jsondata:
return False, (
f"Conformance page does not contain a "
f"conformsTo attribute. See <{spec_url}> for more info."
)
for url in conformance_urls:
http_url = url.replace("https://", "http://")
https_url = url.replace("http://", "https://")
if http_url not in jsondata["conformsTo"] and https_url not in jsondata["conformsTo"]:
return False, (
f"Conformance page does not contain "
f"the core edr class {url}. See <{spec_url}> for more info."
)
return True, "Conformance page contains the required EDR classes."
The spec says:
Which means that both
httpandhttpsURLs are valid, as long as the API adheres to the respective protocol's standards. Maybe the tests should check both with for example: