Skip to content
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

json: cannot unmarshal array into Go struct field MacroAction.macros.actions.value #253

Open
Code-Hex opened this issue Feb 6, 2023 · 1 comment
Labels
Bug Something isn't working
Milestone

Comments

@Code-Hex
Copy link
Contributor

Code-Hex commented Feb 6, 2023

I got an error message when I send a request to /macros.json .
I did the investigation, this error happened when the API responded like the below.

"actions": [
        {
          "field": "side_conversation_ticket",
          "value": [
            "こんにちは",
            "<p>■テストです。</p>",
            "SupportAssignable:support_assignable/group/5291292944015",
            "text/html"
          ]
        }
]
@nukosuke nukosuke added the Bug Something isn't working label Feb 6, 2023
@nukosuke
Copy link
Owner

nukosuke commented Feb 6, 2023

@Code-Hex

Thank you for your report.

The reason is that the Value field of MacroAction struct is fixed to string type.

type MacroAction struct {
Field string `json:"field"`
Value string `json:"value"`
}

We should make it interface{} to handle []string.

@nukosuke nukosuke added this to the v0.14.x milestone Feb 6, 2023
@nukosuke nukosuke modified the milestones: v0.14.x, v0.15.x May 2, 2023
@nukosuke nukosuke modified the milestones: v0.15.x, v0.17.x Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants