Coder Social home page Coder Social logo

Comments (16)

mathieuales avatar mathieuales commented on September 24, 2024

Hi !
It looks like you have circular references in your definitions ...
Do you confirm ?
BR

from angular-swagger-ui.

kreck avatar kreck commented on September 24, 2024

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.

mathieuales avatar mathieuales commented on September 24, 2024

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.

kreck avatar kreck commented on September 24, 2024

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.

mathieuales avatar mathieuales commented on September 24, 2024

should be fixed in 0.2
do you confirm ?

from angular-swagger-ui.

kreck avatar kreck commented on September 24, 2024

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.

mathieuales avatar mathieuales commented on September 24, 2024

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.

kreck avatar kreck commented on September 24, 2024

Okay, i'll investigate it tomorrow and give you feedback as soon as i did!

from angular-swagger-ui.

kreck avatar kreck commented on September 24, 2024

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.

mathieuales avatar mathieuales commented on September 24, 2024

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.

mathieuales avatar mathieuales commented on September 24, 2024

should be fixed in 0.2.2, can you confirm ?

from angular-swagger-ui.

kreck avatar kreck commented on September 24, 2024

i'll check tomorrow and will give immedeate feedback! Thanks for the heads-up

from angular-swagger-ui.

mathieuales avatar mathieuales commented on September 24, 2024

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.

kreck avatar kreck commented on September 24, 2024

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.

bodinegl avatar bodinegl commented on September 24, 2024

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.

bodinegl avatar bodinegl commented on September 24, 2024

0.2.3 is working beautifully. thanks..

On 25 August 2015 at 03:50, Mathieu AlΓ¨s [email protected] wrote:

Closed #16
#16.

β€”
Reply to this email directly or view it on GitHub
#16 (comment)
.

from angular-swagger-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.