-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Projects.SetConfig endpoint fails with 400 Bad Request due to ConfigInput.MaxObjectSizeLimit zero value not being omitted #111
Comments
Thanks for reporting. Since the field is optional, The documentation for the ConfigInput entity says:
The first and last paragraph suggests that It's also possible the documentation is incorrect, though, since the example request shows a string being used:
|
From the first look, |
@andygrunwald It should be possible to infer the type from Gerrit's code. If ProjectInput.java is the right place to look, then using |
You are right. The interface is more suitable and flexible
At 2022-05-27 20:32:38, "Dmitri Shuralyov" ***@***.***> wrote:
Thanks for reporting.
Since the field is optional, MaxObjectSizeLimitInfo is definitely not right as it'll always be included despite the omitempty tag, while *MaxObjectSizeLimitInfo would allow the zero value to be properly omitted.
The documentation for the ConfigInput entity says:
The max object size limit of this project as a MaxObjectSizeLimitInfo entity.
If set to 0, the max object size limit is removed.
If not set, this setting is not updated.
The first and last paragraph suggests that *MaxObjectSizeLimitInfo would be right. However, the "if set to 0" part suggests maybe it can be a string or integer value too? To allow that, I think we'd need to use interface{} and let the user provide the desired type.
It's also possible the documentation is incorrect, though, since the example request shows a string being used:
"max_object_size_limit": "10m",
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I found that the configinfo setting parameter does not take effect, such as State、SubmitType、Actions |
I create TestProjectsService_SetConfig func to test SetConfig requests api fail
error info:
failed: 400 Bad Request
Invalid application/json in request
I find ConfigInput field is MaxObjectSizeLimitInfo, change type string can be success...
The text was updated successfully, but these errors were encountered: