Open tonypowa opened 1 month ago
This issue is a test copy of an issue in another repo. Original issue: https://github.com/grafana/grafana/issues/#87957
Summary: The issue, opened by tonypowa, concerns a problem with the enumeration in a generated OpenAPI file in the Grafana repository, where enum values are incorrectly formatted as a single string instead of a JSON array. A proposed solution is updating go-swagger to v0.31.0, which appears to resolve the issue.
Elaboration:
Thank you for reporting an issue with the OpenAPI specification generated for Grafana. You’ve pointed out a problem with how enums are represented in the JSON file and suggested that upgrading go-swagger might fix the issue. To better assist you and resolve the problem efficiently, could you please provide a bit more detail on the following points?
Reproduction Steps: Can you please elaborate on how we can observe the incorrect enum generation? Some step-by-side instructions or a script to demonstrate the behavior would be very helpful.
Before & After Comparison: Have you already tested the generation with go-swagger v0.31.0 on your end? If so, could you provide a diff or a link to a generated file that shows the correct enum format after the update?
Past Behavior: Although you're not certain if this worked before, any information regarding when you first noticed the issue or if it was introduced after a specific update can help with the investigation.
Environment Details: It seems the environment section was left incomplete. Knowing the version of Grafana, the OS, and the browser where the issue was observed can help us replicate the environment more accurately. Are you able to provide those details?
Error Logs: Are there any logs from Grafana or go-swagger that might give us more context on the issue?
Thanks for your collaboration on this; the detailed report will be crucial in finding a quick solution.
Hi @tonypowa, it appears that the issue you've reported is related to the OpenAPI specifications which would be part of the Backend platform project. I'll tag this issue so it can reach the team working on the backend. In the meantime, if you have the capability to do so, contributions through a pull request with the suggested update are always welcome!
What happened?
There is issue with enum on the generated openapi file, for example here https://github.com/grafana/grafana/blob/main/public/api-merged.json#L21196C15-L21196C27
"[unprocessed active suppressed]"
What did you expect to happen?
Should be
["unprocessed", "active", "suppressed"]
Did this work before?
Can't tell
How do we reproduce it?
Look at the sources.
The issue seems to come from go-swagger (generate spec, and generate client/server from prometheus-alertmanager). Updating to v0.31.0 seems to solve this issue
Is the bug inside a dashboard panel?
No response
Environment (with versions)?
Grafana:
OS:
Browser:
Grafana platform?
None
Datasource(s)?
No response