Skip to content

doc create fails with pydantic ValidationError: CreatePage.description_html required #6

Description

@LouisLau-art

Describe the bug
planecli doc create crashes with a pydantic ValidationError before any request is sent, because CreatePage(name=title) is constructed without the description_html field, which is required (no default) in the current plane-sdk.

To Reproduce

planecli doc create --title "Test doc" --content "hello" -p SOME_PROJECT

Expected behavior
A document is created (or at least the request is attempted).

Actual behavior

pydantic_core._pydantic_core.ValidationError: 1 validation error for CreatePage
description_html
  Field required [input_value={'name': 'Test doc'}, input_type=dict]

Environment

  • planecli 0.5.1
  • plane-sdk 0.2.21
  • Python 3.11

Root cause
In src/planecli/commands/documents.py (create command):

page_data = CreatePage(name=title)
if content:
    page_data.description_html = f"<p>{content}</p>"

plane-sdk's CreatePage model (see plane.models.pages) declares description_html: str with no default, so model construction fails immediately. name is the only field that can be passed unconditionally.

Suggested fix

page_data = CreatePage(name=title, description_html="")
if content:
    page_data.description_html = f"<p>{content}</p>"

I can open a PR with this one-line change if you'd like.

Note (may or may not be related)
After applying the fix locally, doc create (and doc ls) on a self-hosted Plane instance returns HTTP 404: Page not found for both project pages and workspace pages endpoints. That may be a separate server-version issue, but flagging in case page support was removed/changed in newer Plane versions.

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