fix(npm-source): Deprecated field can be bool#2268
Conversation
updatecli diff returns an error when the deprecated field is a bool. json: cannot unmarshal bool into Go struct field versions.Versions.Deprecated of type string This should make it possible to unmarshal Deprecated fields of type string and bool.
v1v
added a commit
to v1v/updatecli
that referenced
this pull request
Jul 5, 2024
…ersion' into feature/use-tools-version * refs/remotes/origin/feature/use-tools-version: deps(go): bump module github.com/hashicorp/hcl/v2 (updatecli#2256) deps: Bump Golang version to 1.22.5 (updatecli#2267) fix(npm-source): Deprecated field can be bool (updatecli#2268)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
updatecli diff returns an error when the deprecated field is a bool.
I was testing it on a
package.jsonwithreactandreact-dom. The exact output below:This should make it possible to unmarshal Deprecated fields of type string and bool.
I did not check all occurrences of the struct and the field, maybe it's required to convert to a specific type somwhere, e.g. in
pkg/plugins/resources/npm/changelog.go(couldn't find out where it is invoked exactly, because it's my first time using updatecli and I'm quite new to it).