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

OpenAPI (Swagger)-compliant REST API self-documenting feature (C++ to OAS JSON spec file generator) #988

Closed
smihaila opened this issue Aug 19, 2021 · 7 comments
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@smihaila
Copy link

smihaila commented Aug 19, 2021

Is your feature request related to a problem? Please describe.
It feels so frustrating that, of of all C++ based Web Application Frameworks out there, only two seem to provide built-in support for an OpenAPI (Swagger) self-documenting feature:

Describe the solution you'd like
It would be great if Drogon could offer a built-in OpenAPI / Swagger-compliant self-documenting feature. Besides other two C++ Web Application Frameworks (Oat++ and Pistache) and which I personally dislike, there is a myriad of other Web Application Frameworks for several other programming languages, offering such support:

  • Python: FastAPI, drf-yasg, falcon-swagger-ui, falcon-apispec, safrs, django-rest-swagger
  • JavaScript / Node.js: swagger-express, apidoc, hapi-swagger, jsdoc + swagger-jsdoc, oas
  • Java: Swagger-Core, SpringFox, and many others
  • C#: NSwag, Swashbuckle
  • Ruby: Source2Swagger
  • PHP: SwaggerPHP
  • Go: go-swagger
  • etc

The feature described herein falls under a "Code-first (then Annotate)" WebAPI documentation mindset. Which is opposite to a "Design-first" mindset.

Describe alternatives you've considered
I'm currently trying Oat++ with its oatpp-swagger module. But I don't like Oat++ as a C++ Web Application Framework, to begin with.
I'm also trying a Doxygen + Sphinx + Breathe pipeline, hoping to somehow be able to add some JavaDoc / Doxygen-style comments and which could be then auto-translated to OpenAPI / Swagger-compliant JSON spec file. Probably via sphinxcontrib-httpdomain plus sphinx-swagger. But the sphinx-swagger seems to be rather old and no longer maintained since July 1st 2017 (last version being 0.4.0).

Additional context
See FastAPI ( https://fastapi.tiangolo.com/features/#automatic-docs ) for an intuitive illustration of what the envisioned feature is.
See also these Oatpp + Oatpp-swagger tutorials:
https://medium.com/oatpp/c-oatpp-web-service-with-swagger-ui-and-auto-documented-endpoints-1d4bb7b82c21
https://dzone.com/articles/c-restful-web-service-with-swagger-ui-and-auto-doc

Thank you.

@marty1885
Copy link
Member

PR #923 is working on the exact feature.

@smihaila
Copy link
Author

That's AWESOME - the timing couldn't have been better, and Drogon rocks!
Thank you.

@rbugajewski
Copy link
Collaborator

Thanks for the feature request. I’m gonna close this issue, as we already have a work in progress PR open covering this exact topic.

@rbugajewski rbugajewski added duplicate This issue or pull request already exists enhancement New feature or request labels Aug 22, 2021
@feliwir
Copy link

feliwir commented Jan 8, 2024

Why is this closed? #923 was never implemented / finished

@aryankarim
Copy link

@Mis1eader-dev now this would be nice if they implement it.

@Mis1eader-dev
Copy link
Member

@Mis1eader-dev now this would be nice if they implement it.

Yes I agree, personally I don't have hands-on experience with Swagger.
I could start working on a PR when I get a good grasp on Swagger.

@vanarp0915
Copy link

Is their any way we can upload a static swagger files in drogon. How we do it on nodeJS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants