utoipa icon indicating copy to clipboard operation
utoipa copied to clipboard

Schema name configuration

Open squadgazzz opened this issue 9 months ago • 1 comments

According to the docs, there is no way to use a different from the struct name in the openaapi doc, like:

#[derive(ToSchema)]
#[schema(name = "Dog")]
pub struct DogSchema;

Which should generate schema Dog instead of DogSchema.

squadgazzz avatar Apr 26 '24 10:04 squadgazzz

According to the docs, there is no way to use a different from the struct name in the openaapi doc, like:

#[derive(ToSchema)]
#[schema(name = "Dog")]
pub struct DogSchema;

Which should generate schema Dog instead of DogSchema.

True, there is no separate attribute for that but as = Dog should be possible. E.g.

#[derive(ToSchema)]
#[schema(as = Dog)]
pub struct DogSchema;

juhaku avatar May 20 '24 18:05 juhaku

Closing due inactivity. Can be reopened if deemed necessary.

juhaku avatar Sep 09 '24 10:09 juhaku