Skip to content

fix(franca): use double-quoted strings in allowed value output - #525

Merged
erikbosch merged 1 commit into
COVESA:masterfrom
SoundMatt:fix/franca-allowed-formatting
Jun 3, 2026
Merged

fix(franca): use double-quoted strings in allowed value output#525
erikbosch merged 1 commit into
COVESA:masterfrom
SoundMatt:fix/franca-allowed-formatting

Conversation

@SoundMatt

Copy link
Copy Markdown
Contributor

The allowed field was emitted using Python's repr() of the list,
producing single-quoted strings like ['January', 'February']. This
is not valid Franca IDL syntax, and for string values containing spaces
(e.g. 'Park Brake') the spaces would appear unescaped inside the
downstream parser's interpretation of the literal.

Emit string elements as "value" (double-quoted) and leave numeric
elements as bare literals, which is consistent with the rest of the
Franca output.

# Before
allowed: ['January', 'February']

# After
allowed: ["January", "February"]

Expected franca output updated for test_allowed accordingly.

Note: PR #514 proposes removing this exporter; this fix applies in the
meantime.

Fixes #336 (franca side)

The allowed field was serialised using Python's list repr, producing
single-quoted strings like ['January', 'February'].  Non-string values
such as integers and floats were unaffected, but string values with
embedded spaces (e.g. 'Park Brake') would appear unquoted in the
downstream Franca parser's view once the outer list brackets are
stripped.

Emit string elements as "value" (double-quoted) and leave numeric
elements as bare literals, matching the JSON-like style used elsewhere
in the Franca output.

Update expected.franca for test_allowed accordingly.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>

@erikbosch erikbosch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

Just a bit curious - do you have an interest in keeping Franca or was this just a regression you noticed when running "all" exporters.

@SoundMatt

SoundMatt commented May 29, 2026 via email

Copy link
Copy Markdown
Contributor Author

@erikbosch
erikbosch merged commit e3ef5f7 into COVESA:master Jun 3, 2026
5 checks passed
ali-momin12 pushed a commit to ali-momin12/vss-tools that referenced this pull request Jun 15, 2026
…A#525)

The allowed field was serialised using Python's list repr, producing
single-quoted strings like ['January', 'February'].  Non-string values
such as integers and floats were unaffected, but string values with
embedded spaces (e.g. 'Park Brake') would appear unquoted in the
downstream Franca parser's view once the outer list brackets are
stripped.

Emit string elements as "value" (double-quoted) and leave numeric
elements as bare literals, matching the JSON-like style used elsewhere
in the Franca output.

Update expected.franca for test_allowed accordingly.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
ali-momin12 pushed a commit to ali-momin12/vss-tools that referenced this pull request Jun 16, 2026
…A#525)

The allowed field was serialised using Python's list repr, producing
single-quoted strings like ['January', 'February'].  Non-string values
such as integers and floats were unaffected, but string values with
embedded spaces (e.g. 'Park Brake') would appear unquoted in the
downstream Franca parser's view once the outer list brackets are
stripped.

Emit string elements as "value" (double-quoted) and leave numeric
elements as bare literals, matching the JSON-like style used elsewhere
in the Franca output.

Update expected.franca for test_allowed accordingly.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
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.

vss2franca: Output with latest VSS catalog not accepted by CommonAPI tooling

2 participants