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

Follow good practices: Make transition from hashbangs (#!) to javascript pushState #1236

Closed
KrzysztofMadejski opened this issue May 4, 2015 · 7 comments
Milestone

Comments

@KrzysztofMadejski
Copy link

http://stackoverflow.com/a/10355561

I still have problems with hashbangs being accumulated if SwaggerUI is not hosted on root url (/).

  • Drop not maintained ba-bbq library during transition.
@KrzysztofMadejski
Copy link
Author

BTW: I guess Backbone is handling transparently history using #! or push state depending on the browser: http://artsy.github.io/blog/2012/06/25/replacing-hashbang-routes-with-pushstate/

@KrzysztofMadejski
Copy link
Author

Now I'm not so sure if routes and hard links done Backbone-way ie. /pet/addPet are a way to go. Why?

  1. You need .htaccess to rewrite abstract urls to base file (a bit harder to deploy)
  2. Views in SwaggerUI are not mutually exclusive, they are states that can coexist (finally I'm not firing Backbone actions while changing url, I still relyon bound js events)

Apart from that changing ba-bbq to better maintained https://github.com/browserstate/history.js/ is probably worth considering sometime in the future.

@ponelat
Copy link
Member

ponelat commented May 5, 2015

Having pushState, would make the urls look cleaner for starters. And moving some more logic into routes would be nice. But it is something to look over, in more detail.

@rescribet
Copy link

I'm new to API documentation so forgive me if this is nonsense.

I was playing around in the petstore example and noticed using a subroute did nothing. Recently I wrote an article about 'semantic documentation' that boils down to the concept of getting the correct API docs when replacing the commonly used 'api' subdomain with 'doc'.

So, wouldn't it be useful, in addition to pushState, to let the UI show documentation based on its route? E.g. let http://petstore.swagger.io/#/pet/3/uploadImage auto-scroll/expand the matching descriptions.

@KrzysztofMadejski
Copy link
Author

As far as I remember that was working some time ago.

On 9 January 2016 at 15:48, Thom van Kalkeren notifications@github.com
wrote:

I'm new to API documentation so forgive me if this is nonsense.

I was playing around in the petstore example and noticed using a subroute
did nothing. Recently I wrote an article about 'semantic documentation'
http://medium.com/@fletcher91/semantic-documentation-1177d563783c that
boils down to the concept of getting the correct API docs when replacing
the commonly used 'api' subdomain with 'doc'.

So, wouldn't it be useful, in addition to pushState, to let the UI show
documentation based on its route? E.g. let
http://petstore.swagger.io/store/order auto-scroll/expand the matching
descriptions.


Reply to this email directly or view it on GitHub
#1236 (comment)
.

Krzysztof Madejski
karolina.wysocka@epf.org.plCode for Poland Program Manager / Koordynator
Koduj Dla Polski
krzysztof.madejski@epf.org.pl / +48 664 082 823

@fehguy
Copy link
Contributor

fehguy commented Jan 12, 2016

This was fixed in 2.1.4. If you try that version, you should see it working fine. It was broken in master for a bit.

@webron
Copy link
Contributor

webron commented Jun 9, 2017

Will be covered by #2884 (ignore the misleading title).

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

5 participants