utoipa icon indicating copy to clipboard operation
utoipa copied to clipboard

Custom tag names for routes.

Open JSH32 opened this issue 2 years ago • 3 comments

Route tags/namespaces at the moment are generated by what is provided in handlers. Might there be a way to specify renames for these tags so that they can be more clear? For example

	tags(
		(paths = [route::admin::user], name = "Admin", description = "Admin endpoints."),
	),

on openapi for example?

JSH32 avatar Jun 15 '22 04:06 JSH32

The #[openapi(...)] is unable to access the tags attribute of the path operation. Instead at the moment what can be done is to define custom tag along with the path operation.

#[utoipa::path(
  tag = "Admin",
...
)]

juhaku avatar Jun 15 '22 07:06 juhaku

Is there a way to sort which order the tags are placed in?

JoshRudnik avatar Jun 16 '22 21:06 JoshRudnik

No they will be organized alphabethical order according to the path. Paths with same tag will be grouped together. The paths will be placed to BTreeMap which will contain order by itself. And also there is no way to sort them in UI. That would require additional JavaScript from the end user but there is no way to provide such unfortunately.

juhaku avatar Jun 20 '22 16:06 juhaku

Closing due inactivity.

juhaku avatar Feb 15 '23 23:02 juhaku