bcgov / DBC-APIM

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

Swagger UI - text cut off #30

Closed BK01 closed 7 years ago

BK01 commented 7 years ago

Custom change to OpenAPI extension (font size or column adjustment, style change) to resolve description text from being cut off. See cat.gov.bc.ca

BK01 commented 7 years ago

Is it possible to take over whole page, or must we stay within iFrame of template? If so, a style or font change will suffice as long as the description column text is no longer cut off.

banders commented 7 years ago

I believe that the cut-off description occurs because of some very long content in the geocoder api descriptions that cannot wrap, so they expand the width of the table. This also causes two columns of the table to be pushed off the screen.

Specifically, the problematic description in the geocoder spec is the following:

Example: -126.0792945083648,49.76287332290923,-126.0163386310997,49.79077056256354 . A bounding box (xmin,ymin,xmax,ymax) that limits the search area. See bbox

The coordinates of the bbox string get treated as a single word that does not wrap.

This could be fixed with a modification to swagger-ui css. I will make the change to my fork of swagger-ui, and will try to get it pulled into the master repo. In the mean time I don't think we should use a non-stock version of swagger-ui within the CKAN openapi extension. Instead, while we wait for my css fix to be accepted, I suggest we continue to use the stock version of swagger-ui, and just modify the geocoder api spec to avoid the cut-off descriptions.

If we do decide to resolve this by updating the geocoder API spec, note that the BCDC record in "cad" seems to be pointing to a swagger resource in Leo's repo. When testing with BCDC, why don't we use a geocoder api spec from the api-specs repository. I think that is our master copy of the spec, so how about we update it to resolve the word-wrap problem?

Thoughts?

BK01 commented 7 years ago

I agree. Please proceed with a modification to your fork of the swagger UI css. For the time being, DataBC can also update the geocoder api spec located in the api-specs repository.

I'm not sure why BCDC cad is pointing to a different repo for the JSON file? Unless there is a reason for this I suggest we have both cad and cat for BCDC point to the /bcgov/api-specs location.

BK01 commented 7 years ago

I have forked the api-spec (authored by mraross), applied the change and submitted a pull request. As soon as its accepted we can re-test.

https://github.com/bcgov/api-specs/pull/125

BK01 commented 7 years ago

A new geocoder.json file has been merged in the master with coordinates adjusted as suggested above.

QA also performed on Gated Geocoder and Route Planner api-specs

banders commented 7 years ago

I have created a patch for swagger-ui so it better handles long words in parameter descriptions (and other content that cannot wrap). My pull request to have the patch introduced back into the master repo is here.

I have not modified any of DataBC's internal tools that utilize swagger-ui (such as the CKAN openapi console extension, or the BCDevX API console) to instead utilize my patched version. I'd prefer for us to use the stock version of swagger-ui if possible, so let's see if my PR gets accepted...

BK01 commented 7 years ago

@banders Can this fix be integrated into our new fork of the core Swagger UI code?

BK01 commented 7 years ago

@ll911 @banders UAT successful in cad.data. Ready to migrate to TEST.

banders commented 7 years ago

Created an issue for this in the swagger-ui repo. The issue has a link to the pull request for my patch.

BK01 commented 7 years ago

@BK01 to review this week

BK01 commented 7 years ago

UAT complete in cat.data... Ready for PROD.

banders commented 7 years ago

The swagger-ui community has merged my pull request into the core.

BK01 commented 7 years ago

Ready to migrate to PROD.