-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
SEO and google-ability of dynamic generation #1608
Comments
While google is getting better at rendering & indexing dynamic content, I'm not sure if swagger-ui is indexable. I do seem to find quite a few swagger-ui instances via google search, but haven't spent a bunch of time figuring out what is being indexed on them. |
Google is getting better, but it does not currently run javascript to the point of making ajax calls, as indicated by their docs. We're evaluating swagger-ui as a candidate for Bitbucket's future API documentation. However, searchability of the documentation is key to making our API accessible. To verify, I got Google to index our swagger site, which confirmed that it merely looks at the index.html and never pulls down the Are there plans to make swagger-ui indexable, or providing a way to generate static HTML offline? |
Related: swagger-api/swagger-editor#664 |
So after learning about the I embedded the swagger json data in a
then loaded that synchronously in the page's head: <script src='/swagger.js' type='text/javascript'></script> fed it to window.swaggerUi = new SwaggerUi({
url: null,
spec: spec,
... And Google now indexes correctly: |
@erikvanzijst - thanks for sharing the details of your research. I'm sure it would prove helpful to other users. |
wow, very useful hack. it's better to add in docs. |
As we're evaluating swagger-ui for our public-facing API documentation, I wonder if its dynamic approach of downloading
swagger.json
and constructing the page at runtime will prevent the documentation from getting crawled and becoming searchable.According to Google:
https://developers.google.com/webmasters/ajax-crawling/docs/learn-more
Is there anything I'm overlooking here, or could this really be an issue?
The text was updated successfully, but these errors were encountered: