Closed pvgenuchten closed 7 months ago
I believe we're running up into this or a related issue as part of a search indexing experiment making heavy use of pygeoapi.
https://github.com/internetofwater/harvest.geoconnex.us/issues/3
I believe the problem is here. https://github.com/geopython/pygeoapi/blob/master/pygeoapi/api.py#L89
I think pygeoapi isn't really doing content negotiation via accept header order. It defaults to json if there's no accept header, and has a hard-coded priority of text/html, json+ld, then json if there is.
This is a high priority for us to fix.
This is now addressed in #795
I think pygeoapi isn't really doing content negotiation via accept header order. It defaults to json if there's no accept header, and has a hard-coded priority of text/html, json+ld, then json if there is.
i got same impression, the behaviour must have been changed a while ago, we have structured data results at least up to march 2020, but currently structured data parsing, at least on google is broken, in my impression it is related to above statement, not providing a accept encoding causes pygeoapi to return json
Since the changes above Our own crawler harvests our pygeoapi urls ok. We haven't gotten any results from Google since the introduction of Rich Results test tool and retirement of the structured data test tool. It seems like google is not indexing structured content based on @type
As per RFC4, this Issue has been inactive for 90 days. In order to manage maintenance burden, it will be automatically closed in 7 days.
As per RFC4, this Issue has been closed due to there being no activity for more than 90 days.
Description if you send a combined accept header of
plain/text, application/ld+json
a json response is returned (i guess json is the catch all format returned for unknown encodings). Expected is to return a json-ld encoding as it is the first match with any of the encodings available in pygeoapiSteps to Reproduce I used poster in chrome to send various accept headers I arrived at this issue when testing microdata using http://linter.structured-data.org, they send a long accept header with various ld types and html, but json is returned, leading to a parse error
Expected behavior pygeoapi returns the encoding for which it finds the first match in the list of requested and available encodings
Screenshots/Tracebacks
Environment