Skip to content

🐛(models) fix allow xapi Extensions with empty string values#631

Open
piptouque wants to merge 2 commits into
openfun:mainfrom
piptouque:fix_allow_extensions_empty_str
Open

🐛(models) fix allow xapi Extensions with empty string values#631
piptouque wants to merge 2 commits into
openfun:mainfrom
piptouque:fix_allow_extensions_empty_str

Conversation

@piptouque

@piptouque piptouque commented Jun 15, 2026

Copy link
Copy Markdown

Purpose

When defined with a bare Dict[...] as a field in a pydantic class, extensions inherit from the config which disallows empty strings in dict values.

This should be allowed according to spec.

An LRS MUST NOT reject a Statement based on the values
of the extensions map.

Proposal

We override the model_config for our extensions to allow for empty strings.

  • Refactored ExtensionMap
  • Override model_config for ExtensionMap
  • Added tests
  • Updated CHANGELOG.md

piptouque added 2 commits June 15, 2026 10:34
The 'extensions` dict is shared by contexts and results,
among others.
When defined with a bare Dict[...] as a field in a pydantic class,
Extensions inherit from the config which disallows
empty strings in dict values.
This, however, should be allowed according to spec:
https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#requirements-18
(An LRS MUST NOT reject a Statement based on the values
of the extensions map).

We must override base the model_config for our extensions.
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