Skip to content
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

Swagger UI - text cut off #30

Closed
BK01 opened this issue Jan 10, 2017 · 13 comments
Closed

Swagger UI - text cut off #30

BK01 opened this issue Jan 10, 2017 · 13 comments

Comments

@BK01
Copy link

BK01 commented Jan 10, 2017

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 BK01 assigned BK01 and banders and unassigned BK01 Jan 10, 2017
@BK01
Copy link
Author

BK01 commented Jan 10, 2017

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
Copy link
Collaborator

banders commented Jan 13, 2017

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
Copy link
Author

BK01 commented Jan 13, 2017

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
Copy link
Author

BK01 commented Jan 13, 2017

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.

bcgov/api-specs#125

@BK01
Copy link
Author

BK01 commented Jan 13, 2017

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
Copy link
Collaborator

banders commented Jan 13, 2017

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 BK01 self-assigned this Jan 17, 2017
@BK01
Copy link
Author

BK01 commented Feb 3, 2017

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

@BK01
Copy link
Author

BK01 commented Feb 16, 2017

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

@banders
Copy link
Collaborator

banders commented Feb 18, 2017

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

@BK01
Copy link
Author

BK01 commented Feb 28, 2017

@BK01 to review this week

@BK01
Copy link
Author

BK01 commented Feb 28, 2017

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

@banders
Copy link
Collaborator

banders commented Mar 3, 2017

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

@BK01 BK01 assigned ll911 and unassigned banders, BK01 and mraross Mar 14, 2017
@BK01
Copy link
Author

BK01 commented Mar 14, 2017

Ready to migrate to PROD.

@BK01 BK01 closed this as completed Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants