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

Documentation generation with new group feature #739

Open
bbedward opened this issue Feb 25, 2025 · 1 comment
Open

Documentation generation with new group feature #739

bbedward opened this issue Feb 25, 2025 · 1 comment
Labels
question Further information is requested

Comments

@bbedward
Copy link

Hi,

Love the framework - it is a huge time saver and a great project.

Groups was added in #728 , however it would be great if the documentation generated included the group path.

For example:

	// /auth group
	authGrp := huma.NewGroup(api, "/auth")
	huma.Get(authGrp, "/login", srvImpl.Login)
	huma.Get(authGrp, "/callback", srvImpl.Callback)

	// /user group
	userGrp := huma.NewGroup(api, "/user")
	userGrp.UseMiddleware(mw.Authenticate)
	huma.Get(userGrp, "/me", srvImpl.Me)

I have a /auth group and a /user group

In the documentation/openapi generation the names are just "get login" "get callback" "get me" - it would be nice if the documentation would include the group path as well. So it would be "get auth login", "get user me", "get auth callback"

Screenshot shows what I'm referring to:

Image

And the openapi.yaml summary:

  /user/me:
    get:
      operationId: get-me
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MeResponseBody"
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ErrorModel"
          description: Error
      summary: Get me
@danielgtaylor danielgtaylor added the question Further information is requested label Feb 26, 2025
@danielgtaylor
Copy link
Owner

@bbedward thanks for the feedback! I'll see what can be done, but keep in mind the auto-generation is best-effort and won't work for all use-cases. You can always use huma.Register instead of huma.Get and provide your own operation ID and summary!

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

No branches or pull requests

2 participants