Skip to content

schemas create --dry-run doesn't validate anything, just echoes input back #8

Description

@rverheijen

Version: hubspot 0.14.0 (build 1162, commit unknown)

Command run:

$ echo '{}' | hubspot schemas create --dry-run
$ echo '{"name":"test_object_xyz"}' | hubspot schemas create --dry-run

Expected result: given schemas create (without --dry-run) rejects both of these bodies with a 400 validation error (Some required fields were not set: [name, labels], then [labels]), the --dry-run equivalent should surface the same validation problem rather than reporting success.

Actual result: --dry-run reports ok: true for both, regardless of body content, simply echoing back whatever was piped in:

$ echo '{}' | hubspot schemas create --dry-run
{"ok":true,"executed":false,"dry_run":true,"data":{}}

$ echo '{"name":"test_object_xyz"}' | hubspot schemas create --dry-run
{"ok":true,"executed":false,"dry_run":true,"data":{"name":"test_object_xyz"}}

$ echo '{}' | hubspot schemas create
{"ok":false,"error":{"status":400,"message":"Invalid input JSON on line 1, column 2. Some required fields were not set: [name, labels]"}}

For comparison, schemas update --dry-run genuinely calls the API - it returns portal-specific data (state_snapshot, digest, the actual portal ID), so this isn't true of every --dry-run in the CLI, just schemas create (and possibly other create commands - not exhaustively tested).

Why this matters: the README's own beta warning recommends using --dry-run before mutations as the safety practice for a tool that can modify live CRM data. For schemas create, a passing dry-run gives no assurance the real call will succeed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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