Skip to content

JSON unmarshal error: plugins.enabled returned as string instead of bool #69

@Somfic

Description

@Somfic

After updating to go-passbolt-cli v0.4.0, any command that requires login fails with a JSON unmarshaling error when fetching server settings.

The CLI fails to parse the server settings response because passbolt.plugins.enabled is returned as a string by the server, but ServerPassboltPluginSettings expects a bool type.

Stacktrace

Error: Logging in: Getting Server Settings: json: cannot unmarshal string into Go struct field ServerPassboltPluginSettings.passbolt.plugins.enabled of type bool

Environment

  • go-passbolt-cli version: 0.4.0 (Git SHA v0.4.0)
  • OS: NixOS, Linux 6.18.2 x86_64
  • Installation method: nixpkgs

Steps to Reproduce

  1. Configure passbolt CLI with passbolt configure
  2. Run any command that requires authentication, e.g., passbolt list resource

I think the ServerPassboltPluginSettings.Enabled field may need to use a custom JSON unmarshaler that handles both string and bool types, or the struct field type should be changed to accommodate the server's response format..

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