Skip to content

PublicationDate UnmarshalJSON requires (y,m,d), payload doesn't have them. #141

@jitenpathy

Description

@jitenpathy

go-genai/types.go

Lines 1044 to 1057 in a75a9ae

if aux.PublicationDate != nil {
var year, month, day int
var ok bool
if year, ok = aux.PublicationDate["year"]; !ok {
return fmt.Errorf("key %q not found", "year")
}
if month, ok = aux.PublicationDate["month"]; !ok {
return fmt.Errorf("key %q not found", "month")
}
if day, ok = aux.PublicationDate["day"]; !ok {
return fmt.Errorf("key %q not found", "day")
}
c.PublicationDate = &civil.Date{Year: year, Month: time.Month(month), Day: day}

Fields for PublicationDate shouldn't be mandatory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions