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

Error when not using inline type definitions #111

Open
bbkane opened this issue May 29, 2022 · 0 comments
Open

Error when not using inline type definitions #111

bbkane opened this issue May 29, 2022 · 0 comments

Comments

@bbkane
Copy link

bbkane commented May 29, 2022

JSON:

I have validated this JSON with jq.

{
  "data": [
    [
      "1",
      "2",
      "3"
    ],
    [
      "3",
      "4",
      "5"
    ]
  ],
  "columns": [
    {
      "title": "time"
    },
    {
      "title": "x"
    },
    {
      "title": "y"
    }
  ],
  "columnDefs": [
    {
      "className": "dt-center",
      "targets": "_all"
    }
  ],
  "pageLength": 50
}

Error: 2:13: expected ';', found '[' (and 1 more errors)

Oddly enough, when I check the Inline type definitions checkbox, I get the following (expected) output:

type AutoGenerated struct {
	Data    [][]string `json:"data"`
	Columns []struct {
		Title string `json:"title"`
	} `json:"columns"`
	ColumnDefs []struct {
		ClassName string `json:"className"`
		Targets   string `json:"targets"`
	} `json:"columnDefs"`
	PageLength int `json:"pageLength"`
}

Screenshot (note the JSON extends beyond the range of this screenshot):

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant