You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.
Today I tried to include swagger-ui version 3 with a naif/raw implementation meant to discover:
what we can do with v3
how we can eventually customize it
and .... make it work.
In the process, I removed some code that was not required anymore since the implementation changed. Now the swagger specification is loaded client side where as before was embedded directly as javascript object.
The removed code was mostly about re-rendering the code snippet to embed a new version of the specification when there is a change, now loading and rendering are done client side, so the re-render of the "server-side" code snippet will be irrelevant (it will re-render the same code snippet).
The downside is that I have to include third party libraries also when the swagger_ui tag is not actually used, but I believe that a less connected solution should be possible with the help of hexo's 'hooks', if not, the code will be restored (something like this is also an option).
Some of my findings:
Pros
We can use directly the official swagger-ui version instead of the actual angular-boostrap version and including it directly from public cdns
swagger-ui styles are already namespaced by being applied just to children of '.swagger-ui' css class, so no more problem about including our custom swagger-ui.css made to avoid conflicts (we can just use the css cdn version), that means also smaller LICENSE to embed
UI looks overall nicer
Deep linking working quiet nicely (@zmeda this update should solve your issue )
Plugins System (I wrote a minimal plugin into a redux action)
Cons
With this raw implementation, the performance and reactivity of the page seems to suffer, it seems heavier than v2 angular-bootstrap version, might be misconfiguration. The time to fetch the specification should be also taken into account.
Authorize / Dialog UI has to be adjusted heavily to work nicely inside the theme context, as v2
The text was updated successfully, but these errors were encountered:
* feat(swagger): use url spec for v3, remove premature optimization
* refactor(swagger-ui): isolate to run v2 and v3 in parallel
* isolate css using hexo-swagger-ui-v* namespaces
* always use snake case for options
* always use url to "instrument" swagger-ui
* refactor(swagger-ui): minor style adjustments
closes#24
* feat(swagger): use url spec for v3, remove premature optimization
* refactor(swagger-ui): isolate to run v2 and v3 in parallel
* isolate css using hexo-swagger-ui-v* namespaces
* always use snake case for options
* always use url to "instrument" swagger-ui
* refactor(swagger-ui): minor style adjustments
closes#24
Use version 3 of swagger-ui
see git branch
Update 26/10/2017
Today I tried to include swagger-ui version 3 with a naif/raw implementation meant to discover:
In the process, I removed some code that was not required anymore since the implementation changed. Now the swagger specification is loaded client side where as before was embedded directly as javascript object.
The removed code was mostly about re-rendering the code snippet to embed a new version of the specification when there is a change, now loading and rendering are done client side, so the re-render of the "server-side" code snippet will be irrelevant (it will re-render the same code snippet).
The downside is that I have to include third party libraries also when the
swagger_ui
tag is not actually used, but I believe that a less connected solution should be possible with the help of hexo's 'hooks', if not, the code will be restored (something like this is also an option).Some of my findings:
Pros
Cons
With this raw implementation, the performance and reactivity of the page seems to suffer, it seems heavier than v2 angular-bootstrap version, might be misconfiguration. The time to fetch the specification should be also taken into account.
Authorize / Dialog UI has to be adjusted heavily to work nicely inside the theme context, as v2
The text was updated successfully, but these errors were encountered: