8000 {snipeit} cannot unmarshal hardware last_audit_date & next_audit_date · Issue #5 · gemini-oss/rego · GitHub
[go: up one dir, main page]

Skip to content

{snipeit} cannot unmarshal hardware last_audit_date & next_audit_date #5

Open

Description

@e-mar404

Code to reproduce:

package main

import (
	"github.com/joho/godotenv"
	"github.com/gemini-oss/rego/pkg/snipeit"
)

func main() {
	err := godotenv.Load()
	if err != nil {
		panic(err)
	}

	_, clientErr := snipeit.NewClient(1).Assets().GetAllAssets()
	if clientErr != nil {
		panic(clientErr)
	}
}	

.env file

Using base url and token from snipe api reference examples.

Error gotten:

If asset has last_audit_date set I get this:

{snipeit} {assets.go:111} FATAL - Error fetching hardware list: unmarshalling error: json: cannot unmarshal object into Go struct field Hardware.rows.last_audit_date of type string

It also happens on next_audit_date

Activity

  1. e-mar404 commented on Jan 16, 2025

    @e-mar404
    Author

    found the same issue to happen with both EOL and WarrantyExpires fields in hardware struct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0