Skip to content

adapter.json, adapter.xml: Retain falsy Extension and Qualifier values - #683

Open
LivingLikeKrillin wants to merge 1 commit into
eclipse-basyx:developfrom
LivingLikeKrillin:fix/zero-extension-qualifier-value
Open

LivingLikeKrillin wants to merge 1 commit into
eclipse-basyx:developfrom
LivingLikeKrillin:fix/zero-extension-qualifier-value

Conversation

@LivingLikeKrillin

Copy link
Copy Markdown

The JSON and XML serializers previously wrote an Extension or Qualifier value only if it evaluated to truthy. Consequently, 0, Decimal("0"), and False were dropped and read back as None.

The serializers now check that the value is not None, matching Property. Falsy values are therefore preserved, and round-trip tests for both the JSON and XML adapters verify that 0, Decimal("0"), and False deserialize correctly.

Fixes #682

Testing

  • python -m unittest in sdk: 274 tests OK (8 skipped: no CouchDB / schema files locally).
  • With serializer changes reverted, the new tests fail for all three values in both adapters.
  • mypy basyx test: no issues.
  • ruff check: all checks passed.

🤖 Generated with Claude Code

Extension and Qualifier values are currently written only if truthy,
so 0, Decimal("0"), and False are dropped and read back as None.
They are now written whenever not None so that they survive a
write/read round trip.

Fixes eclipse-basyx#682

Signed-off-by: Jooyoung Jung <livinglikekrillin@gmail.com>
Assisted-by: Anthropic Claude Opus 5.5 (claude-opus-5-5)
@LivingLikeKrillin
LivingLikeKrillin force-pushed the fix/zero-extension-qualifier-value branch from 9dc44e3 to 486b6fa Compare October 31, 2026 00:33
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