Skip to content

[Bug] Entity Update API pages use wrong HTTP method and Content-Type in "Try it" feature #164

@RajdeepKushwaha5

Description

@RajdeepKushwaha5

Description

The "Update" API docs pages for entities (Dashboards, Tables, etc.) show PATCH /v1/<entity>/{id} with a "Try it" button, but the "Try it" feature sends Content-Type: application/json with a plain JSON body.

The server's PATCH endpoints require:

  • Content-Type: application/json-patch+json
  • Body: RFC 6902 JSON Patch array (e.g., [{"op": "replace", "path": "/description", "value": "new value"}])

This causes a 415 Unsupported Media Type error for anyone using the "Try it" feature.

Reported in: open-metadata/OpenMetadata#26689

Affected Pages

Root Cause

The docs pages describe the update operation as "JSON Merge Patch" with a plain JSON object body, but the server implements RFC 6902 JSON Patch which requires:

  1. Content-Type: application/json-patch+json (not application/json)
  2. An array of patch operations (not a plain JSON object)

The server also exposes PUT /v1/<entity> for full create-or-update with Content-Type: application/json and a full Create<Entity> body — this is the correct method for replacing/upserting an entity.

Suggested Fix

Each entity "Update" page should either:

  1. Show the PUT endpoint for create-or-update:

    • Method: PUT /v1/dashboards
    • Content-Type: application/json
    • Body: Full CreateDashboard JSON object (name, service, etc.)
  2. Or keep PATCH but fix the Content-Type and body format:

    • Method: PATCH /v1/dashboards/{id}
    • Content-Type: application/json-patch+json
    • Body: [{"op": "replace", "path": "/description", "value": "Updated description"}]

Option 1 is recommended since it matches what the Python SDK's create_or_update() does.

Metadata

Metadata

Assignees

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