Skip to content

docs(units): a create may name its unit by unitExternalId alone - #105

Merged
JosteinGj merged 2 commits into
masterfrom
docs/timeseries-unit-external-id-rules
Oct 1, 2026
Merged

JosteinGj merged 2 commits into
masterfrom
docs/timeseries-unit-external-id-rules

Conversation

@JosteinGj

Copy link
Copy Markdown
Contributor

Creating a timeseries with only unitExternalId (no unit) used to be rejected on validation with 400 timeseries.unit.not.blank. That was wrong: unitExternalId names an entry in the unit catalogue (GET /units), so it identifies the unit fully. The platform fix is IntelliStream-DataHub/datahub-platform#146.

New rules on create (POST /timeseries/create and MCP timeseries_create):

  • unitExternalId only: accepted if the catalogue has it; unit is filled from the entry's symbol (or name).
  • unit + known unitExternalId: both kept as sent.
  • unit only: unchanged, catalogue not consulted.
  • blank or unknown unitExternalId: 400 on unitExternalId, with or without unit. Breaking: an unknown one used to be accepted beside unit.
  • neither: 400 as before.

On update, setting unitExternalId to a blank or unknown value is a 400 before anything is written; setNull still clears it.

Pages:

  • docs/guides/work-with-units.mdx: replaced the "unit is required, unitExternalId is never checked" paragraph with a small table of the rules, the normalisation note and the update rule.
  • docs/reference/timeseries.md: one paragraph under "Create a series" linking to the guide, and the update rule in "List and update series".
  • docs/mcp-server.mdx: timeseries_create row says a unitExternalId must be in the catalogue.

Published content needs a sync-docs republish after merge.

🤖 Generated with Claude Code

The platform (branch fix/timeseries-create-rejected-unit-external-id-alone,
PR #146) now accepts a timeseries create with only unitExternalId and fills
unit from the catalogue, and refuses a blank or unknown unitExternalId with
a 400 on create and update. That made wrong the claim that unit is required
and unitExternalId is never checked against the catalogue.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
@JosteinGj
JosteinGj merged commit 59adf7b into master Oct 1, 2026
4 checks passed
@JosteinGj
JosteinGj deleted the docs/timeseries-unit-external-id-rules branch October 1, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant