Skip to content

[#495] Remove the Text DataType - #660

Merged
wes-johnson merged 3 commits into
eclipse-sparkplug:developfrom
wes-johnson:495-remove-text
Nov 25, 2026
Merged

wes-johnson merged 3 commits into
eclipse-sparkplug:developfrom
wes-johnson:495-remove-text

Conversation

@wes-johnson

@wes-johnson wes-johnson commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Addresses #495, by removing the type rather than completing the set.

Why not add TextArray

Text was never distinguishable from String. Both were defined as "String value (UTF-8)", both map to Protocol Buffers string, both ride in ValueArray's string_values, and nothing anywhere in the specification said what made one different from the other.

Inductive Automation's tag data types, which Sparkplug's are modelled on, deprecated Text in Ignition 8.1.8 and document no difference between the two either. Ignition also has a String Array and no Text array — the same asymmetry #495 reports here.

So adding TextArray would create a second array type whose elements are indistinguishable from StringArray's: it duplicates the ambiguity rather than resolving it. Sparkplug 4 is unreleased, so the type can go now at no cost to anyone, which is the same reasoning that retired the protobuf extension ranges in #643.

The change

Specification Text = 14 removed from both copies of the DataType enum; its definition block removed; ValueArray's string_values comment is now // String
TCK models Text removed from DataSetDataType, PropertyDataType, ParameterDataType, MetricDataType, and from their case 14: mappings, which now fall to Unknown
TCK logic the switch arms folding Text in with String are gone; SendComplexDataTest's Basic Types upper bound becomes DateTime
TCK fixtures the utility Edge Node drops its Text and MyText metrics and the Texts column of its DataSet. Nothing referenced those by name

Second commit: closing the gap

Removing Text left 14 unused. Sparkplug 4 is unreleased and no implementation depends on these numbers yet, so the second commit closes the gap rather than documenting it: every value above 14 moves down by one and the enum runs 0–34 with nothing missing.

UUID becomes 14, DataSet 15, Bytes 16, File 17, Template 18, PropertySet 19, PropertySetList 20, the array types 21–33, and Command 34.

Shifted in both copies of the enum, in the "Sparkplug enum value" line of every affected type's definition, and in the TCK's vendored DataType model enums including the case labels that map an integer back to a type. DataSetDataType and ParameterDataType are untouched because they only carry Basic Types, none of which moved.

The two commits are separate so the removal can be reviewed on its merits and the renumbering judged on its own — if the working group would rather keep the numbers stable for implementations already tracking v4 drafts, the second commit can simply be dropped.

What this does not do

The large-value use Text was informally put to — JSON documents, XML, long logs — is the subject of #444, which proposes a type for generic JSON. That is the defined successor, and it is tracked separately.

The other gaps #495 raised are unaffected: UUID has no array type, Bytes/File arrays would need a new repeated bytes field in ValueArray, and arrays of templates are #450.

Verification

Build successful, 10/10 unit tests pass. Broken-anchor (11) and tck-id-anomaly (7) baselines unchanged. JSON Schema valid draft 2020-12, 22/22 chapter examples validate. DataType values run 0–34 with no gaps, all 35 documented "Sparkplug enum value" lines agree with the enum, and the TCK model enums agree with the schema. Renumbering verified by executing the regenerated classes: DateTime still 13, UUID 14, DataSet 15, Template 18, Int8Array 21, DateTimeArray 33, Command 34, nothing declared at 35. No Text reference remains in the chapter or in tck/src/main/java. git diff --check clean.

Text was never distinguishable from String. Both were defined as
"String value (UTF-8)", both map to Protocol Buffers string, both ride
in ValueArray's string_values, and nothing anywhere in the
specification said what made one different from the other.

Inductive Automation, whose tag types Sparkplug's are modelled on,
deprecated Text in Ignition 8.1.8 and documents no difference between
the two either. Ignition also has a String Array and no Text array,
which is the same asymmetry eclipse-sparkplug#495 reported here.

So this removes Text rather than defining it or adding the TextArray
that would complete the set, since a second array type whose elements
are indistinguishable from StringArray's would duplicate the ambiguity
rather than resolve it. Sparkplug 4 is unreleased, so the type can go
now at no cost to anyone.

Enum value 14 is left unused, with a comment recording what it was.
Renumbering the types above it would churn every implementation already
tracking v4 drafts for no benefit.

On the TCK side: Text is removed from the four vendored DataType model
enums and from the switch arms that folded it in with String, the
Basic Types upper bound in SendComplexDataTest becomes DateTime, and
the utility Edge Node drops its Text metrics and the Texts column of
its DataSet fixture. Nothing referenced those by name.

The large-value use Text was informally put to is the subject of eclipse-sparkplug#444,
which proposes a type for generic JSON.
Removing Text left 14 unused. Sparkplug 4 is unreleased and no
implementation depends on these numbers yet, so the gap is closed
rather than documented: every value above it moves down by one, and
the enum runs 0 to 34 with nothing missing.

UUID becomes 14, DataSet 15, Bytes 16, File 17, Template 18,
PropertySet 19, PropertySetList 20, the array types 21 to 33, and
Command 34.

Shifted in both copies of the enum in the chapter, in the "Sparkplug
enum value" line of every affected type's definition, and in the four
vendored DataType model enums in the TCK, including the case labels
that map an integer back to a type.

Verified by executing the regenerated classes rather than by reading
the diff: DateTime is still 13, UUID is 14, DataSet 15, Template 18,
Int8Array 21, DateTimeArray 33, Command 34, nothing is declared at 35,
and the TCK model enums agree with the schema. A cross-check of all 35
documented "Sparkplug enum value" lines against the enum finds no
mismatch.

@ckienle ckienle left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing Text (074dca1): agreed. It was indistinguishable from String in its definition, its protobuf type and its array field, and Ignition deprecated it in 8.1.8. I checked:

  • no Text reference is left in the specification, tck/src or the web console;
  • the chapter's JSON examples use type names, not numbers;
  • the TCK generates SparkplugBProto from the chapter itself, so it can't drift from it;
  • the case 14 mappings, the Basic Types bound in SendComplexDataTest and the utility Edge Node fixtures are all updated.

Renumbering (5ee309e): I'd drop this commit, as you offered. Until now v4's DataType values matched v3's (spBv1.0) exactly, with Command added at 35. An implementation that speaks both spBv1.0 and spPv4.0 (Tahu, and products that support both namespaces) can therefore share one enum. Shifting 14–34 means those values name different types in each namespace, so any code path that misses the translation silently reads a v3 Template (19) as a v4 PropertySet. Leaving the gap costs nothing.

If commit 2 goes, keep the retired value reserved. Add reserved 14; and reserved "Text"; to both copies of the enum, the usual protobuf way to retire a value, so nobody reuses 14 for something else.

I'll approve once the renumbering question is settled. The anchor note inline is minor.

** Google Protocol Buffer Type: string
** Sparkplug enum value: 14

[[payloads_p_datatype_additional]]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the Text block also removed the blank line before this anchor, so Asciidoctor treats [[payloads_p_datatype_additional]] as part of the DateTime item's paragraph, and the id doesn't appear in the HTML. I built the HTML: develop has <div id="payloads_p_datatype_additional" class="ulist"> and this branch has no element with that id. Nothing in the spec links to it, but outside deep links would break. Restoring the blank line above it fixes it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 53db58c. Good catch — and the kind that only shows up if you actually render the document.

Removing the Text block took the blank line that separated it from the anchor with it, so Asciidoctor read [[payloads_p_datatype_additional]] as part of the preceding DateTime paragraph. Confirmed the way you did, by building the HTML: the id is absent before the change and present after, alongside payloads_p_datatype_basic and payloads_p_datatype_array.

I also swept every chapter for an anchor with no blank line above it. One other turned up, in Sparkplug_8_HA.adoc:165, but it is inside a //// comment block and identical on develop, so it is inert and pre-existing.

Worth noting my own anchor check would never have caught this: it verifies that every link:# target resolves to an anchor in the source, which this one still did. The failure was in the rendering, which only a build of the HTML exposes.

@ckienle ckienle left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, renumbering included. Wes and I talked it through, and closing the gap now, while v4 is unreleased, is fine. With it, reserved 14 isn't needed.

The anchor note at Payloads.adoc:1773 still applies: the missing blank line before [[payloads_p_datatype_additional]] drops that id from the HTML. It's minor; fix it here or later.

…Types anchor

Removing the Text block took the blank line that separated it from
[[payloads_p_datatype_additional]] with it, so Asciidoctor read the
anchor as part of the preceding DateTime paragraph and the id did not
appear in the rendered HTML at all. Nothing in the specification links
to it, but a deep link from outside would have broken.

Confirmed by building the HTML: the id is absent before this change and
present after, alongside payloads_p_datatype_basic and
payloads_p_datatype_array.

A sweep of every chapter for an anchor with no blank line above it
finds one other, inside a //// comment block in Sparkplug_8_HA.adoc,
which is identical on develop and inert.
@wes-johnson
wes-johnson merged commit e816288 into eclipse-sparkplug:develop Nov 25, 2026
3 checks passed
@wes-johnson
wes-johnson deleted the 495-remove-text branch November 25, 2026 18:58
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.

3 participants