Coder Social home page Coder Social logo

Comments (10)

JamesMessinger avatar JamesMessinger commented on May 23, 2024

Are you sure you're using the latest version of Swagger Parser? The require('swagger-parser').bundle() method is simply a pass-through to require('json-schema-ref-parser').bundle() method. There's no additional logic inside Swagger Parser, so if JSON Schema $Ref Parser works, then so should Swagger Parser.

from swagger-parser.

isadovskiy avatar isadovskiy commented on May 23, 2024

@BigstickCarpet, just installed it today. It's "3.4.1". BTW, swagger-cli console app also produces bad results for me.

Looks like I tried json-schema-ref-parser version 3.1.2 and it works fine. While swagger-parser installed 1.4.1 for itself into its own node_modules and uses it

from swagger-parser.

isadovskiy avatar isadovskiy commented on May 23, 2024

https://github.com/BigstickCarpet/swagger-parser/blob/master/package.json#L80

It looks like time to upgrade this dependency ;)

from swagger-parser.

isadovskiy avatar isadovskiy commented on May 23, 2024

I tried to make a quick fix but failed because of parse() method aguments incompatibility in SwaggerParser and $RefParser. Looks like normalizeArgs() method should be copied to SwaggerParser. But I'm not sure if it's good solution. @BigstickCarpet, do you have better idea for?

from swagger-parser.

JamesMessinger avatar JamesMessinger commented on May 23, 2024

@isadovskiy - Ah, now I remember. I was in the middle of a refactoring a few months ago, and then I started a new job and kinda dropped the ball on all my opensource projects for a while. I guess this issue will be my motivation to pick-up where I left off before. It's not as simple as upgrading the dependency or making a minor code change, unfortunately.

from swagger-parser.

isadovskiy avatar isadovskiy commented on May 23, 2024

@BigstickCarpet I made a change in my repo - isadovskiy@942be0c. Seems it fixed the issue. However i'm not sure about side effects. Also it's not so elegant since I copied normalizeArgs() method.

from swagger-parser.

JamesMessinger avatar JamesMessinger commented on May 23, 2024

👍 Cool. You can use that fork for now, and I'll let you know as soon as I get the permanent fix committed here.

from swagger-parser.

isadovskiy avatar isadovskiy commented on May 23, 2024

Thanks! i'll be waiting for solid fix.

from swagger-parser.

isadovskiy avatar isadovskiy commented on May 23, 2024

Looks like Options object is also incompatible...

from swagger-parser.

arnaudbreton avatar arnaudbreton commented on May 23, 2024

I'm experiencing the same issue now using either swagger parser or CLI. Was a fix made since then?

My referenced get nested into a parameter definition, leading to weird issue in Swagger Editor. On the other side, --dereference works like a charm but leads to unused definition warnings in Swagger Editor.

Thanks for your help!

from swagger-parser.

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.