Clarification on Controllers, Middlewares, Handlers, and Proposal for Automated OAS Generation #2491
MuhmdHsn313
started this conversation in
Ideas
Replies: 1 comment
-
👍 Great idea! Clarifying the roles of controllers, middlewares, and handlers is definitely helpful. And the proposal for automated OAS generation using route data is brilliant! It would streamline API documentation significantly. Looking forward to seeing this in action! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Iris team,
I'm exploring the differences between controllers, middlewares, and handlers in the Iris framework. I noticed that controllers are used within the MVC package (referencing
controller.go
), while handlers and middlewares seem to be more tied to the core routing system (referencingroute.go
). Could you help clarify the specific roles and distinctions between these three components in Iris?This clarification leads me to a potential feature idea. I noticed that the
Route
struct (fromroute.go
) already contains detailed data about routes—such as methods, paths, handlers, etc. Would it be possible to implement an automated generation of OpenAPI Specifications (OAS) based on this route data? Since theRoute
struct holds key information, a relatively small addition could allow for automatically generating OAS documentation.Looking forward to your thoughts on this!
Best regards,
Beta Was this translation helpful? Give feedback.
All reactions