-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WorkBC API Console - Industries parameter #68
Comments
The issue affects OAS2. It is related to parameters that are passed as form data. Seems that for OAS2 recent versions of swagger-ui are issuing requests with Content Type headers that are not consistent with form data parameters. The Content Type should be We have also translated the "jobposting" spec to OAS3, so I tested with that under the latest release of swagger-ui (3.4.2) as well. This version of swagger-ui appears to have buggy support for @BK01 In summary, there are two separate problems with the latest version of swagger-ui: one affecting how form data are handled for OAS2 specs, and another affecting how form data are handled in OAS3 specs. Because we are migrating our specs to OAS3, I suggest we pursue a solution affecting OAS3 only. Thoughts? |
@banders Thank you for identifying the issue. I agree, given the timing and progress already made on OAS3 / s-ui in BCDC, please proceed with a solution in OAS3. I have temporarily removed the link to the new viewer for WorkBC and replaced with the old viewer. Once resolved, we can switch back. |
@BK01 - UAT with latest viewer |
@BK01 Are you testing with the OAS3 spec? https://raw.githubusercontent.com/banders/api-specs/upgrade-to-openapi3/jobposting/jobposting.json The new version of swagger-ui (not yet deployed in CAD right?) should fix the issue for the /jobs POST operation using OAS3. (There is still a swagger-ui bug affecting this operation for OAS2, as described above.) |
Will confirm status on swagger-ui, re-assign and place in QA pipeline for now. |
DataBC to include Marina in UAT plan |
Version of swagger-ui (3.4.4) used in cad.data still has a bug. Swagger community to be notified. Tested in cad.data and petstore. |
Re-raised this problem with the swagger-ui community: |
@BK01 I have tested the latest swagger-ui against the WorkBC API, but there's still a problem with the way that swagger-ui encodes the industries parameter. I have investigated the problem thoroughly, and tried various modifications to the API spec in an effort to fix the issue, but I have not been successful. I posted an a issue with the swagger-ui community. I hope that the community can advise on whether this is a bug or a problem with our API spec. |
@BK01 The swagger-ui community believes that our difficulty with the Industries parameter in the WorkBC API is indeed due to a bug in swagger-ui: swagger-api/swagger-ui#4071 (comment) They are aiming to have a fix included in the Jan 12 milestone. |
Test to be repeated next week, following by a tentative date selection for migration of viewer to PROD. |
@banders to review release 3.11 for fix |
@ll911 @BK01 I am testing the latest swagger-ui to determine if it addresses the WorkBC API issue, but I ran into a snag: Looks like there is a CORS issue with the https://workbcjobs.api.gov.bc.ca when testing from my local dev PC (on localhost:9090). Is the server configured to include the "Access-Control-Allow-Origin: *" header? |
|
@ll911 Hmm... not working for me from a browser (Chrome): GET https://workbcjobs.api.gov.bc.ca/v1/jobTypes I'm seeing these response headers: content-length:61 |
@ll911 seems to be working now. Suddenly the same request I made above is returning: access-control-allow-origin:* Did you change something? |
@ll911 I'm getting the CORS exception again from CURL and the API Console. Looks like it might be related to an HTTP 403 error. Any idea why the request would be returning 403? curl -I -XGET https://workbcjobs.api.gov.bc.ca/v1/regions/ |
@BK01 @ll911 The problem I mentioned above with CORS and HTTP 403 still seems to be affecting the WorkBC Jobs API, although the issue is intermittent. During those times when the API is working for me, I was able to test it with the latest version of swagger-ui (3.12.1). The new version fixes queries that use the Industries parameter on the POST /jobs endpoint. I incorporated the new swagger-ui into ckanext-openapiviewer. The PR has been merged. Can you try deploying in CAD? You can test the Industries parameter using the following post data:
|
deployed to cad |
Test 1: In chrome on cad.data I didn't see a specific error message, but also don't see the expected response using the test case above (industry = 16) as compared with the older API console Test 2: In Firefox on cad.data I received the following error message along with the same response as above in test 1. "TypeError: NetworkError when attempting to fetch resource." |
I'm seeing intermittent HTTP 403 errors for the Router API. I have tested from my PC and from a remote server. Seems like the API works for about 5 minutes, then gives 403 for 5 minutes, then works again, then 403... This is similar to what I mentioned yesterday for the WorkBC API. It is causing the API Console to report CORS errors (because the HTTP 403 response doesn't include CORS headers). Does DataBC notice intermittent 403s from the router and WorkBC APIs? |
DataBC - Test OAS3 spec in BCDC DLV works with industries only. Migrate new console to TEST / PROD (3.12.1). @BK01 create delivery booking |
Repeated UAT today. Inconsistent results found. In the first test, results showed no difference in number of records by industry (2000+). TypeError: Failed to fetch for second test. |
Tests all successful at 2:15pm 2018-03-27 |
The Industries parameter in the WorkBC API console does not appear to be working. Please investigate and update the api-spec.
Test performed:
Leave all parameters blank, with the exception of the Industry parameter. Enter ‘16’ and execute. Look at the total count of results returned and note the number. Now re-execute, but change the industry ID to ‘3’. The total count and the results don’t change at all.
spec:
https://github.com/bcgov/api-specs/tree/master/jobposting
However, the same parameter appears to work in the old console:
http://apps.gov.bc.ca/pub/api-explorer/?url=https://workbcjobs.api.gov.bc.ca/v1/specs/#!/Job_Feed/post_jobs
The text was updated successfully, but these errors were encountered: