Comments (16)
Hi !
It looks like you have circular references in your definitions ...
Do you confirm ?
BR
from angular-swagger-ui.
Hi!
Yes i do, but i need them. I think i tracked the problem down to the function getSampleObj() which gets stuck in the recursion, as there is no "depth-limit".
The same problem seems to be applicable to the generateModel() function. I temporarily fixed it, by having both functions return an empty string, but of course now no schema and model definition is displayed.
Do you have a quick fix in mind, how we can make sure that recursion stops once an object/definition has been "seen"? I played around a little with a third "counter" parameter, but with no luck.
Feedback is much appreciated!
PS: awesome project, i like it a lot.
from angular-swagger-ui.
I don't have any quick fix ... How is this handled by http://petstore.swagger.io/ ?
Do you have a simple online example i could use ?
from angular-swagger-ui.
Hi,
here is a sample Swagger JSON file with the problem. You can use the raw link and directly paste it into the swagger ui.
https://gist.github.com/kreck/0ea64225d1fa6ab4d7f6
(raw https://gist.githubusercontent.com/kreck/0ea64225d1fa6ab4d7f6/raw/5860e43cb7497447059b3ce5a35d6d36899a8014/swagger.json)
It works fine on http://petstore.swagger.io, but not on http://orange-opensource.github.io/angular-swagger-ui
from angular-swagger-ui.
should be fixed in 0.2
do you confirm ?
from angular-swagger-ui.
Hi Mathieu,
Thanks for your quick responses!
i just tried it, there is no more overflow, but it also doesn't render anything and doesn't produce an error message. Meaning: the http request is sent and received but the directive doesn't render nor do i see any error. Any ideas?
from angular-swagger-ui.
It works for me when using the file you sent me and putting it in on my server.
It doesn't work when using https://gist.githubusercontent.com/kreck/0ea64225d1fa6ab4d7f6/raw/5860e43cb7497447059b3ce5a35d6d36899a8014/swagger.json because response content-type is text-plain, it should be application/json.
from angular-swagger-ui.
Okay, i'll investigate it tomorrow and give you feedback as soon as i did!
from angular-swagger-ui.
Hi Mathieu,
v. 0.2.1. fixed the issue, thank you very much! However there is a new bug. This one can be very easily fixed, though.
The repeaters in the directive generate duplicates (in the recursion cases). This prevents display. I quick-fixed it by adding a simple track by $index
.
ng-repeat="op in api.operations track by $index"
ng-repeat="api in resources track by $index"
ng-repeat="param in op.parameters track by $index"
ng-repeat="value in param.enum track by $index"
ng-repeat="(code, resp) in op.responses track by $index"
I'm not (yet) sure how to properly file a pull-request, so i guess it is easier if you make the addition to the template. With that fix the issue can be closed. Thank you also very much for publishing it on bower!
from angular-swagger-ui.
Hi !
Can't reproduce the issue with the file located here https://gist.githubusercontent.com/kreck/0ea64225d1fa6ab4d7f6/raw/5860e43cb7497447059b3ce5a35d6d36899a8014/swagger.json
from angular-swagger-ui.
should be fixed in 0.2.2, can you confirm ?
from angular-swagger-ui.
i'll check tomorrow and will give immedeate feedback! Thanks for the heads-up
from angular-swagger-ui.
I finally reproduced the issue when using 'ngRoute'. If you do so, you can fix the issue by adding reloadOnSearch = false in your route configuration
from angular-swagger-ui.
It seems like the current version fixed it! I'm using angular-ui-router by the way, not ngRoute. I've found one more bug which might be due to my routing. I'll open a new issue if it is not. This issue can be closed however. Thank you very much!
from angular-swagger-ui.
the reloadonsearch did fix the problem when I stay in the swaggerui page,
but if I navigate way and then click a button then navigate back I do see
dup paths. I am using a location.path = ... within a button click()
function to do the navigation. maybe this is the issue you found. I am
using the $routeProvider in a config.
On 24 August 2015 at 13:43, kreck [email protected] wrote:
It seems like the current version fixed it! I'm using angular-ui-router by
the way, not ngRoute. I've found one more bug which might be due to my
routing. I'll open a new issue if it is not. This issue can be closed
however. Thank you very much!β
Reply to this email directly or view it on GitHub
#16 (comment)
.
from angular-swagger-ui.
0.2.3 is working beautifully. thanks..
On 25 August 2015 at 03:50, Mathieu Alès [email protected] wrote:
β
Reply to this email directly or view it on GitHub
#16 (comment)
.
from angular-swagger-ui.
Related Issues (20)
- render curl
- Html5 UI-router compatibiltiy HOT 1
- URL Parse Error when adding swagger-ui div HOT 2
- Publish older version on npm HOT 2
- Unable to npm install [email protected] HOT 3
- Node 8 support HOT 2
- Issue with rendering multiple api key in angular-swagger-ui HOT 3
- how to validate yaml by schema? HOT 1
- Syntax Error cant show petstore example HOT 8
- Question: Benefits & Comparisons HOT 2
- doesn't it support external references? HOT 4
- Works with any version lower than 0.5.0, but stops working from 0.5.0 HOT 5
- always the same model and sample when operationId is not specified HOT 3
- api key authorization configuration thru swaggerUiAuthProvider.credentials not working HOT 5
- Swagger UI page unresponsive for large swagger json HOT 6
- have a config to expand/list operations on load HOT 1
- Unknown provider: $swaggerTranslatorProvider HOT 1
- swagger ui fails to show sample response with items in response HOT 1
- Angular 7 support? HOT 2
- how to avoid sanitize? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-swagger-ui.