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

Support for description and summary attributes on #[utoipa::path] macro. #781

Closed
mortifia opened this issue Oct 17, 2023 · 2 comments · Fixed by #948
Closed

Support for description and summary attributes on #[utoipa::path] macro. #781

mortifia opened this issue Oct 17, 2023 · 2 comments · Fixed by #948

Comments

@mortifia
Copy link

https://swagger.io/specification/?sbsearch=description#path-item-object

in #[utoipa::path()]

when i add description or summary
unexpected identifier, expected any of: operation_id, path, get, post, put, delete, options, head, patch, trace, connect, request_body, responses, params, tag, security, context_path

@juhaku
Copy link
Owner

juhaku commented Oct 26, 2023

That is by design. There is no description nor summary attributes on #[utoipa::path] macro. The description and summary is currently only resolved from the doc comment above the handler function. There has been a request for having support for these values as attributes on #[utoipa::path] path macro. This is something that can be added in future.

Relatead #439

@juhaku juhaku changed the title Bug: path description Support for description and summary attributes on #[utoipa::path] macro. Oct 26, 2023
juhaku added a commit that referenced this issue May 24, 2024
Add `description = ...` and `summary = ...` attributes for
`#[utoipa::path(...)]` attribute macro to allow description and summary
overriding. When these attributes are defined the values are not
resolved from the doc comment above the function.

The value can be either literal string or expression e.g. reference to a
`const` variable or `include_str!(...)` statement.

Relates to #802

Resolves #439 Resolves #781
@juhaku juhaku moved this to In Progress in utoipa kanban May 24, 2024
@juhaku
Copy link
Owner

juhaku commented May 24, 2024

I have now implemented support for the description = ... and summary = ... attributes here #948

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

Successfully merging a pull request may close this issue.

2 participants