Skip to content
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

Update to Swagger spec v2 #54

Closed
STRML opened this issue Oct 7, 2014 · 15 comments
Closed

Update to Swagger spec v2 #54

STRML opened this issue Oct 7, 2014 · 15 comments
Assignees
Labels

Comments

@STRML
Copy link
Member

STRML commented Oct 7, 2014

I think we should wait a few weeks on this anyway because there's some instability (like a recent bug in swagger-ui that defaulted all routes to GET regardless of their verb), but eventually we'll want to update loopback-explorer's JSON output to Swagger v2.

@nhagen
Copy link

nhagen commented Jan 17, 2015

Any update on this?

@bajtos
Copy link
Member

bajtos commented Jan 20, 2015

@nhagen I am afraid upgrading to 2.0 is not a priority for us at the moment. Can you contribute the upgrade yourself?

@OwenBrotherwood
Copy link

Is there a use case for the need for Swagger v2.x?
It is possible for loopback to use a v2.x ie v2 spec to remoting metadata.
It is possible for loopback to present a v1.x so that other software can use the api.
Some common software still have not "upgraded" to use Swagger v2 eg postman so it looks like the priority for v2 is correct....

@bajtos
Copy link
Member

bajtos commented Apr 21, 2015

It is possible for loopback to use a v2.x ie v2 spec to remoting metadata.

LoopBack uses it's own format for describing remoting metadata. loopback-explorer converts from this custom format to Swagger spec.

I suppose we could support both 1.x and 2.x versions of Swagger spec, either expose each version on a different URL, or provide a configuration option so that the developer calling loopback-explorer can decide which version to use.

@OwenBrotherwood
Copy link

Unless someone has a good use case, there doesn't seem any reason to expose 2.x
I was just wondering if there was a good use case.
Until there comes some world dominating piece of software that will only use 2.x, 1.x looks ok.

@nhagen
Copy link

nhagen commented Apr 21, 2015

I think this might have originally been an issue for me because I wanted to use swagger-js, which IIRC is 2.0 only right now. I don't remember off the top of my head, however.

My view: If loopback is offering Swagger support as a feature that attracts users, those users are going to expect that it will work with other swagger tools. If there is are no plans to support mainline/future Swagger, it should be forked into "Strongloop API Spec". This is especially true if there are no docs specifying how to use the swagger features with other tools. Otherwise I think there's a lot of confusion about what is and isn't compatible with Loopback.

I think all of the core swagger tooling is 2.0 now, so anyone who is coming into the ecosystem is going to be put off if they spend time writing out their spec thinking its useful for many libraries and find out only some of them will consume it.

@raymondfeng
Copy link
Member

LoopBack can enhance the endpoint to expose swagger 2.0 spec in addition to 1.2. The spec generator can potentially produce different versions per client request.

It should not be too hard to add the 2.0 support. Contributions are welcome!

@fadeojo
Copy link

fadeojo commented Jun 21, 2015

I think loopback has set a great standard for Nodejs frameworks and swagger 2.0 should be supported. I have tried to convert the swagger 1.2 Api declaration to 2.0 with no success (swagger tools). Please add support for 2.0. I will try and put in my two cents but I'm still learning. Thanks.

@bajtos bajtos added the major label Jun 22, 2015
@STRML
Copy link
Member Author

STRML commented Jun 23, 2015

FYI, the advert page at strongloop.com says Loopback generates Swagger 2.0 documentation, which is not true.

@Kampfgnom
Copy link

👍 Is someone working on this? I will try to find the time to look into it, but that won't be in the next few days or even weeks.

@raymondfeng
Copy link
Member

We're starting to look into it.

@sachinhub
Copy link

We are trying to publish API generated via loopback onto wso2 publisher. WSO2 publisher version 1.9 can import API from swagger URL. It expects it to be 2.0 specs.

Any update on when we can expect swagger 2.0 spec URL in loopback from timeline perspective?

@bajtos
Copy link
Member

bajtos commented Aug 21, 2015

FYI: I've just submitted a pull request implementing Swagger Spec 2.0 generator for code review, see #115

@bajtos
Copy link
Member

bajtos commented Aug 31, 2015

The patch has been landed. I'd like to make few more cleanups and improvements before making a new release. You can npm install strongloop/loopback-explorer to try the new version before it's released to npm.

@OwenBrotherwood
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests