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

Generate API in Swagger format #1

Open
JensRantil opened this issue Jul 10, 2017 · 15 comments
Open

Generate API in Swagger format #1

JensRantil opened this issue Jul 10, 2017 · 15 comments

Comments

@JensRantil
Copy link

Swagger/OpenAPI is a very popular format for documenting, and generating clients, for APIs. Has there been any discussions about supporting Swagger generation? I couldn't find any issue for it.

This came out of go-chi/chi#226.

@keith6014
Copy link

any update from the author about this? it would be a great feature

@VojtechVitek
Copy link
Contributor

Authors are open to contributions :)

@keith6014
Copy link

i understand. i don't know swagger well nor do I know go well :-(

ATM, I am using goa it works but a total PITA to setup.

@keith6014
Copy link

ok. i see the work for RAML. seem you are taking care of a lot of stuff already.
Can you give me some tips for adding swagger support? where is a good place to start?

@thejmazz
Copy link

I'd say read (glancing as appropiate) RAML and OpenAPI specs (can't say which order is best), and check out mulesoft's oas-raml-converter, which is specifically useful for its lost semantics sections.

@Scapal
Copy link

Scapal commented Feb 22, 2019

Maybe a framework plugin for swaggo/swag would be the way to go ?

@JohnLockwood
Copy link

@Scapal Agree that swaggo looks like a promising approach. @keith6014 are you working on it or is this one still pretty fair game?

@lelvisl
Copy link

lelvisl commented May 13, 2019

Some updates?

@alee792
Copy link

alee792 commented Jun 11, 2019

I haven't tried it out myself, but since chi is pretty much fancy net/http, it appears as if Swaggo works.

@tiny-dancer
Copy link

tiny-dancer commented Jun 12, 2019

we've successfully used swaggo with chi (not via docgen though)

@fr3fou
Copy link

fr3fou commented Apr 8, 2020

any news? it's been almost 3 years

@VojtechVitek
Copy link
Contributor

Authors are still open to contributions :)

Or.. you can hire us.

@leyafo
Copy link

leyafo commented Aug 2, 2021

I want to finish the docment generate features, does anyone tell me how to start this work?

@EwenQuim
Copy link

I'm currently using swaggo too, but I dislike the fact that it's comment-based: the documentation can deviate from the real routes and controllers. Generating a swagger from Go code really is a pain, and shouldn't be, as an industry standard...

I've built swaglint to try to minimize these differences, but I think it's not enough.

The problem with automatic generation is about knowing in advance the types sent, if we want to be 100% swagger compliant. Chi, as a net/http router, cannot know in advance what will be sent to the http.Writer. The best chi can do is listing the routes, methods and path params. I think the problem is too complicated and need a framework (like NestJS), and so doesn't apply to a router like Chi (correct me in I'm wrong).

I'm in favor of closing the issue as "wontfix" because it's not in the scope of Chi.

@marrow16
Copy link

marrow16 commented Nov 6, 2023

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

No branches or pull requests