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 unmarshal error #12

Closed
spartan117aut opened this issue Jan 29, 2024 · 2 comments · Fixed by #13
Closed

Json unmarshal error #12

spartan117aut opened this issue Jan 29, 2024 · 2 comments · Fixed by #13
Assignees

Comments

@spartan117aut
Copy link

spartan117aut commented Jan 29, 2024

Hi,

thanks for adding #9 so quickly. While testing, I ran into this error:

2024/01/29 14:58:26.941661 get.go:28: Error unmarshalling json: json: cannot unmarshal number into Go struct field Ipam_subnet_data.data.id of type string
Error: json: cannot unmarshal number into Go struct field Ipam_subnet_data.data.id of type string
Usage:
phpipamsync get pi-hole [flags]

Flags:
-h, --help help for pi-hole

Error: json: cannot unmarshal number into Go struct field Ipam_subnet_data.data.id of type string

I then tried it again with version 0.1.2 but got the same error. So I suspect it has to do with the update of phpipam that I did meanwhile. My phpipam version is: v1.6.0 git 97bc4d97

I have no experience with go, but I played around a little and found that I probably could get rid of the errors by setting the datatype to int for the respective variables in internal/cli/get_types.go

@IvanKuchin IvanKuchin self-assigned this Jan 30, 2024
@IvanKuchin IvanKuchin linked a pull request Jan 30, 2024 that will close this issue
@IvanKuchin
Copy link
Owner

IvanKuchin commented Jan 30, 2024

since 1.6 phpipam has changed json-schema.
The problem has been fixed.

@spartan117aut
Copy link
Author

Thanks, now it works.

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

Successfully merging a pull request may close this issue.

2 participants