bcgov / DBC-APIM

DataBC OPEN API Services
Apache License 2.0
1 stars 0 forks source link

Route Planner API Console #65

Closed BK01 closed 6 years ago

BK01 commented 6 years ago

The current (prod) Route Planner API console in BCDC is experiencing formatting issues with the section headings. Specifically there are headings with inactive open/close icons. Please review and debug.

API spec:

API console:

BCDC metadata record:

banders commented 6 years ago

@BK01 @ll911 I think I have fixed the issues that you were referring to. Pull request here.

The current version of swagger-ui presents all tags listed in the top-level "tags" object. Each is rendered as an expandable container listing all paths that have been assigned to the tag. An expandable container that appears not to expand when clicked is caused by a top-level tag with no paths assigned. To avoid this, I have removed the top-level tags that weren't used.

BK01 commented 6 years ago

@banders @ll911 Debugging issue in PROD.

TypeError: NetworkError when attempting to fetch resource

banders commented 6 years ago

@BK01 @ll911 I see a different error: TypeError: Failed to fetch

Looks like this error is because the HTTP OPTIONS request is failing. For example:

curl -X OPTIONS "https://router.api.gov.bc.ca/directions.json?points=-123.70794%2C48.77869%2C-123.53785%2C48.38200&outputSRS=4326&criteria=shortest&distanceUnit=km&routeDescription=Routing%20results"

Could this be a Kong issue?

ll911 commented 6 years ago

https://router.api.gov.bc.ca/directions.json?routeDescription=spansProvinceFastest&points=-126.844567%2C49.978503%2C-122.799997%2C58.925305&outputSRS=4326&criteria=fastest&distanceUnit=km&apikey=${yourAPIKEY}https://router.api.gov.bc.ca/directions.json?routeDescription=spansProvinceFastest&points=-126.844567%2C49.978503%2C-122.799997%2C58.925305&outputSRS=4326&criteria=fastest&distanceUnit=km&apikey=$%7byourAPIKEY%7d

ll911 commented 6 years ago

https://online.swagger.io/validator/debug?url=https://raw.githubusercontent.com/bcgov/api-specs/master/router/router.json

BK01 commented 6 years ago

I found that a request to the API via web browser and script worked, however, I experienced the issue in the console. Getting the following message using the link provided by ll911 above. "{"schemaValidationMessages":[{"level":"error","message":"Unable to read content. It may be invalid JSON or YAML"}]}"

banders commented 6 years ago

@BK01 @ll911 Fixed the parse error. PR here.

... but I still see an error in the API Console when I try to execute a request. I think swagger-ui might be omitting the api key from HTTP OPTIONS requests.

BK01 commented 6 years ago

I can see the same omission in the header.

BK01 commented 6 years ago

DataBC to explore options and examine gated geocoder vs. route planner with sending OPTIONS in request. New issue introduced with latest release of swagger.

ll911 commented 6 years ago

@BK01 this is fixed at GW

BK01 commented 6 years ago

UAT completed successfully in PROD

BK01 commented 6 years ago

UAT complete in cad.data. Headings verified.