Reading data after getJSON

I hope someone can help.
I had thought I had become and expert using getJSON and reading the data in to usable chunks.
But for this case I am having problems.
In the the readout on the left is the output from getJSON which successfully reads the data.
The left of the image is the output and the right the the segment of code generating the image using with and .

I’d normally pull out relevant data using .description.html for the name and time .end.local “GMT” for instance.
But for this case I get an error.
On inspection the JSON format seems different.
Can anyone see what the issue might be.

Many thanks


I can’t see anything wrong with your code, assuming the data ALWAYS has the structure you show. Are you sure that’s the case?

You might be able to check that with something like:

{{ range $eventAllEvents }}
  {{ if reflect.IsMap . }}
    {{ warnf "description.html = %s" .description.html }}
  {{ else }}
    {{ errorf "element of eventAllEvents is not a map"  }}
  {{ end }}
{{ end }}

Hi jmooring,
Thanks for this.

It appears that this is not a map

The error returned is:-

element of eventAllEvents is not a map  logged 1 error(s) 
hugo v0.111.3+extended darwin/arm64 BuildDate=unknown

Reload Page

I have no idea why this would not be a json map.

Are you executing this code multiple times?

Yes, I eventbrite api suggests to call the api multiple times with the latest continuation code.

Then, during one or more of the calls, you are not getting the data that you expect.

Thanks, I have been trying check that out.
It seems for some reason the getJSON is in fact not a map.
But I cannot see why.
I have striped the call to the bare bones and used your code to check this.
But I can’t see way the api call is not returning the json map in this case.

Without access to your project I am unable to help.