Closed jvanulde closed 3 years ago
This should be fixed now, but I don't know how to test it.
Still seems to be an issue. Can be tested by looking at the queryables for a collection. For example:
You will notice the following errors:
I set the ogc_schemas_location path to where the files are located in Lambda which is "/var/task/schemas.opengis.net " However, it's still sending a request to "http://schemas.opengis.net" website. Is that how it's supposed to work or it should send the request to geo-api.dev.riskprofiler.ca for getting the ogc features?
It should send the request to geo-api.dev.riskprofiler.ca. Not sure what's happening. Let me try a local build to see if I get the same result.
In your case, do you see it sending the request to your localhost instead of "http://schemas.opengis.net"? No matter what I try, it's always sending the request to that website. I know it's pygeoapi that's deployed in lambda is seeing the files that exist in /var/task/schemas.opengis.net, because if I change that path, it throws an error saying ogc is misconfigured.
I figured what the issue is. The generated openapi.yml file actually contains the URL to the OGC schemas. Those URLs are generated differently depending on whether you have set the parameter for ogc_schemas_location or not. When the openapi.yml file was generated originally, the ogc_schemas_location wasn't set, so the URLs were set to http://schemas.opengis.net I regenerated the openapi.yml and it's good now.
Nice find @arashmalekz. Working great now.
Fix is to edit the config to point to the local OGC Schema directory. The schemas are already being pulled into the container: https://github.com/geopython/pygeoapi/blob/master/Dockerfile#L92-L95
This would solve the issue where we are getting mixed content errors. Needs to be set here:
https://github.com/OpenDRR/pygeoapi/blob/ea8b4544bee7ce3c931b658206631fd08add24ae/pygeoapi-config.yml#L51
and here:
https://github.com/OpenDRR/pygeoapi/blob/ea8b4544bee7ce3c931b658206631fd08add24ae/docker/default.config.yml#L52