moxious / triage

testing triage actions for issues
0 stars 1 forks source link

Incorrect generated api #354

Open tonypowa opened 1 month ago

tonypowa commented 1 month ago

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

tonypowa commented 1 month ago

This issue is a test copy of an issue in another repo. Original issue: https://github.com/grafana/grafana/issues/#87957

moxious commented 1 month ago

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.

moxious commented 1 month ago

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?

Thanks for your collaboration on this; the detailed report will be crucial in finding a quick solution.

moxious commented 1 month ago

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!