fix: improve generated openapi.json (#584)
* fix: /bots/{bot}
Paths "/bots/{bot}" and "/bots/{target}" must not be equivalent.
Signed-off-by: Damocles078 <hellodamocles078@gmail.com>
* fix: /channels/{group_id}/recipients/{member_id}
Paths "/channels/{group_id}/recipients/{member_id}" and "/channels/{target}/recipients/{member}" must not be equivalent.
Signed-off-by: Damocles078 <hellodamocles078@gmail.com>
* fix: /channels/{channel_id}/webhook
Paths "/channels/{target}/webhooks" and "/channels/{channel_id}/webhooks" must not be equivalent.
Signed-off-by: Damocles078 <hellodamocles078@gmail.com>
* fix: /servers/{server_id}/members/{member_id}
Paths "/servers/{target}/members/{member}" and "/servers/{server}/members/{member}" must not be equivalent.
Signed-off-by: Damocles078 <hellodamocles078@gmail.com>
* fix: /custom/emoji/{emoji_id}
Paths "/custom/emoji/{id}" and "/custom/emoji/{emoji_id}" must not be equivalent.
Signed-off-by: Damocles078 <hellodamocles078@gmail.com>
---------
Signed-off-by: Damocles078 <hellodamocles078@gmail.com>
Signed-off-by: Damocles <106018783+Damocles078@users.noreply.github.com>
This commit is contained in:
@@ -11,11 +11,11 @@ use rocket::{serde::json::Json, State};
|
||||
///
|
||||
/// Create an emoji by its Autumn upload id.
|
||||
#[openapi(tag = "Emojis")]
|
||||
#[put("/emoji/<id>", data = "<data>")]
|
||||
#[put("/emoji/<emoji_id>", data = "<data>")]
|
||||
pub async fn create_emoji(
|
||||
db: &State<Database>,
|
||||
user: User,
|
||||
id: String,
|
||||
emoji_id: String,
|
||||
data: Json<v0::DataCreateEmoji>,
|
||||
) -> Result<Json<v0::Emoji>> {
|
||||
let config = config().await;
|
||||
@@ -50,11 +50,11 @@ pub async fn create_emoji(
|
||||
};
|
||||
|
||||
// Find the relevant attachment
|
||||
let attachment = File::use_emoji(db, &id, &id, &user.id).await?;
|
||||
let attachment = File::use_emoji(db, &emoji_id, &emoji_id, &user.id).await?;
|
||||
|
||||
// Create the emoji object
|
||||
let emoji = Emoji {
|
||||
id,
|
||||
id: emoji_id,
|
||||
parent: data.parent.into(),
|
||||
creator_id: user.id,
|
||||
name: data.name,
|
||||
|
||||
Reference in New Issue
Block a user