Skip to content
This repository was archived by the owner on Mar 21, 2026. It is now read-only.
This repository was archived by the owner on Mar 21, 2026. It is now read-only.

Would be great to encode structured parameters as JSON #12

Description

@qris

For example, linode.disk.createfromstackscript takes a parameter StackScriptUDFResponses:

StackScriptUDFResponses - string (required)
JSON encoded name/value pairs, answering this StackScript's User Defined Fields

It's not clear whether it's allowed to pass actual JSON data to this parameter. In fact, it doesn't work, and the following code fails:

env.api.linode_disk_createfromstackscript(
    StackScriptUDFResponses={'hostname': env.target_host}, ...)

If I encode the structured data as a string first, then it works:

env.api.linode_disk_createfromstackscript(
    StackScriptUDFResponses=json.dumps({'hostname': env.target_host}), ...)

But it would be great if linode-python could either warn me that I'm trying to pass a non-string value for a parameter, or automatically encode it as JSON for me. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions