LukeHagar / plex-api-spec

An open source Plex Media Server API Specification
MIT License
27 stars 8 forks source link

Fix newRegistration type for pins endpoint #30

Closed katyatitkova closed 2 weeks ago

katyatitkova commented 2 weeks ago

I'm using the Go SDK, and whenever I tried to get the token, I was getting the following error: Error: error unmarshalling json response body: json: cannot unmarshal bool into Go value of type string. I downloaded the SDK code and changed the NewRegistration type to bool, and it works now. I assume it's the place where the type should be changed.

LukeHagar commented 2 weeks ago

Great catch!

My current tooling sets nullable items to strings by default, but I should update that functionality.

This is a great PR, I'm going to make a small change later and merge this in. Thank you!

katyatitkova commented 1 week ago

Hi @LukeHagar! I checked plexgo v0.10.0 and it looks like this change isn't reflected there (as well as #31). Is it intentional, or did I forget to make some other changes that are required?

LukeHagar commented 1 week ago

Could be a CI/Automation issue, I'll take a look.

LukeHagar commented 1 week ago

The current type is definitely generated correctly

https://github.com/LukeHagar/plexgo/blob/main/models/operations/getpin.go#L179

Can you validate it updated successfully?

katyatitkova commented 1 week ago

Hmm, it looks like I experienced some kind of a caching issue with Github. Before I posted here, go get seemingly fetched v0.9.0 while showing that it fetched v0.10.0, and Github showed old code when I was choosing either main branch or v0.10.0 tag. I see the new code now here on Github, and re-running go get fetched the correct version with the changes included. Thank you for checking and sorry for bothering!

katyatitkova commented 1 week ago

Maybe that was simpler than the cashing issue as I found another newRegistration field that still wasn't bool, so maybe I saw the code for this endpoint when I first experienced problems. (I checked for #31 as well, but might have wrongly understood that as well.) #32 fixes it.