[API] Inconsistent Label Format #4782

Closed
opened 2025-11-02 06:02:43 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @6543 on GitHub (Feb 3, 2020).

discoverd on gitea version: 1.10.3

https://try.gitea.io/api/swagger#/issue/issueListLabels
https://try.gitea.io/api/swagger#/issue/issueCreateLabel
there is one inconsistency on those calls
List Labels return the color without #
but Create Label requires the #
it's not a big deal but it is kinda boring for someone who uses it
Because then you get errors like this:
panic: Error creating label [Affects Agent e11d21 This will require a new release of TrustFactor agents]: 422 Unprocessable Entity: [{"fieldNames":["Color"],"classification":"SizeError","message":"Size"}]

Originally created by @6543 on GitHub (Feb 3, 2020). discoverd on gitea version: 1.10.3 https://try.gitea.io/api/swagger#/issue/issueListLabels https://try.gitea.io/api/swagger#/issue/issueCreateLabel there is one inconsistency on those calls List Labels return the color without # but Create Label requires the # it's not a big deal but it is kinda boring for someone who uses it Because then you get errors like this: ` panic: Error creating label [Affects Agent e11d21 This will require a new release of TrustFactor agents]: 422 Unprocessable Entity: [{"fieldNames":["Color"],"classification":"SizeError","message":"Size"}] `
GiteaMirror added the type/enhancement label 2025-11-02 06:02:43 -06:00
Author
Owner

@6543 commented on GitHub (Feb 3, 2020):

posible solution: display issueCreateLabel example without '#' and make it pars version with and without '#' on the beginning

@6543 commented on GitHub (Feb 3, 2020): posible solution: display issueCreateLabel example without '#' and make it pars version with and without '#' on the beginning
Author
Owner

@hilariocoelho commented on GitHub (Feb 3, 2020):

Actually I was kinda thinking about appending the # to the List Labels response

@hilariocoelho commented on GitHub (Feb 3, 2020): Actually I was kinda thinking about appending the `#` to the List Labels response
Author
Owner

@6543 commented on GitHub (Feb 3, 2020):

this would breace backwards compatebilety :(

@6543 commented on GitHub (Feb 3, 2020): this would breace backwards compatebilety :(
Author
Owner

@jolheiser commented on GitHub (Feb 3, 2020):

posible solution: display issueCreateLabel example without '#' and make it pars version with and without '#' on the beginning

Parsing it regardless of # sounds reasonable to me.

@jolheiser commented on GitHub (Feb 3, 2020): > posible solution: display issueCreateLabel example without '#' and make it pars version with and without '#' on the beginning Parsing it regardless of `#` sounds reasonable to me.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4782