Skip to content

Add shorthand for published in datamodel fields and calls - #7322

Merged
cplaursen merged 2 commits into
masterfrom
private/cpardill/datamodel-published-shorthand
Oct 9, 2026
Merged

cplaursen merged 2 commits into
masterfrom
private/cpardill/datamodel-published-shorthand

Conversation

@cplaursen

@cplaursen cplaursen commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

This PR removes duplication from the datamodel fields and calls by adding a shorthand for when fields were published, which applies whenever the lifecycle description is identical to the field description and the field lifecycle is only published.
The changes are pure refactors, with no behaviour change. This was verified by checking that the generated datamodel definitions are identical before and after the changes.

@psafont psafont left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Neat!

Most fields and messages are published in a single release with a
lifecycle description identical to their own description, which forces
every stanza to spell the same text twice:

  ~lifecycle:[(Published, rel_rio, "Some text")] ... "Some text"

Accept ~published:rel as a shorthand that builds
[(Published, rel, desc)] (or doc, for messages). Passing both
~lifecycle and ~published is an error, as is passing neither.

Signed-off-by: Christian Pardillo Laursen <christian.pardillolaursen@citrix.com>
This commit removes duplication in every datamodel field/call whose lifecycle
is a single [(Published, rel, text)] entry with text equal to the field
description or the message's explicit ~doc.

The resulting Datamodel.all_api value is byte-identical to the one
before this change (compared via Marshal), and so is the gen_json
output.

Signed-off-by: Christian Pardillo Laursen <christian.pardillolaursen@citrix.com>
@cplaursen
cplaursen force-pushed the private/cpardill/datamodel-published-shorthand branch from a998a56 to 89d0b36 Compare October 9, 2026 14:26
@cplaursen
cplaursen added this pull request to the merge queue Oct 9, 2026
Merged via the queue into master with commit a07b078 Oct 9, 2026
28 checks passed
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