Skip to content

Https urls currently not allowed in conformance checks #66

Description

@fjugipe

The spec says:

Image

Image

Which means that both http and https URLs are valid, as long as the API adheres to the respective protocol's standards. Maybe the tests should check both with for example:

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."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions