Skip to content

'/api' route does not handle 'Accept' header for OGC API Feautes - part 2 spec requirement.  #281

@NicolaiLolansen

Description

@NicolaiLolansen

'/api' route does not handle 'Accept' header for OGC API Feautes - part 2 spec requirement. Content-type of the route /api should be content-type: application/vnd.oai.openapi+json;version=3.0. Probably all that needs here is to instead of using JSONResponse, use something like:

class VndResponse(JSONResponse):
    media_type = application/vnd.oai.openapi+json;version=3.0

Recreate problem using teamengine:
http://cite.opengeospatial.org/teamengine/ ( or for local instances, a docker image is supplied here: https://cite.opengeospatial.org/teamengine/about/ogcapi-features-1.0/1.0/site/ see the docker section log in with ogctest:ogctest. If using docker you have to use the ip for localhost, use ipconfig or similar to find it)

Teamengine will check the OGC API implementation against spec, and notify you of any problems. Since Stac-Api is based on OGC API i would assume it to pass this check.

The teamengine test fails this task:

Test Name: api Definition Validation
Test Description: Implements A.2.3. API Definition Path {root}/api (link), Abstract Test 6 (Requirement /req/core/api-definition-success) | Details ↗Class Name:ApiDefinitionMethod Name:apiDefinitionValidationPath:org/opengis/cite/ogcapifeatures10/conformance/core/apidefinition/ApiDefinition
Test Result: FAILED

In laymans terms this test refers to https://docs.opengeospatial.org/is/17-069r3/17-069r3.html#_api_definition_path_rootapi_link which states that api-definition-success (https://docs.opengeospatial.org/is/17-069r3/17-069r3.html#_response_2)

should fulfill requirement 4 which states:

Requirement 4 /req/core/api-definition-success
A A GET request to the URI of an API definition linked from the landing page (link relations service-desc or service-doc) with an Accept header with the value of the link property type SHALL return a document consistent with the requested media type.

And right now the requested media-type is supposed to be content-type: application/vnd.oai.openapi+json;version=3.0 but is simply application/json and so the test fails.

I have tried looking into where to implement this, but i fail to see how exactly the /api route is handled, maybe it's something core to FastAPI itself.

Metadata

Metadata

Assignees

Labels

specCompliance with STAC/OGC specifications

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions