Skip to content

feat: classes for optional features can indicate wehether they cannot act - #1534

Open
jkowalleck wants to merge 14 commits into
mainfrom
feat/optional-featires-cannot
Open

jkowalleck wants to merge 14 commits into
mainfrom
feat/optional-featires-cannot

Conversation

@jkowalleck

@jkowalleck jkowalleck commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Added

  • Optional-feature classes expose a static cannot property
    It tells whether missing optional dependencies prevent the class from acting:
    false when the feature is available;
    otherwise an object with a message describing why the feature is unavailable.
    Affected classes:
    • Serialize.JsonSerializer — always false
    • Serialize.XmlSerializer — always false in web builds; in node it depends on an optional XML library
    • Validation.JsonValidator
    • Validation.JsonStrictValidator
    • Validation.XmlValidator

Changed

  • Serialize.XmlSerializer, Validation.JsonValidator, Validation.JsonStrictValidator and Validation.XmlValidator
    now throw MissingOptionalDependencyError based on the new cannot check,
    instead of wrapping the underlying OptPlugError

… act

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck
jkowalleck requested a review from a team as a code owner November 2, 2026 11:04
@jkowalleck jkowalleck added the enhancement New feature or request label Nov 2, 2026
@codacy-production

codacy-production Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · -2 duplication

Metric Results
Complexity 0
Duplication -2

View in Codacy

🔴 Coverage 73.86% diff coverage · -0.35% coverage variation

Metric Results
Coverage variation ✅ -0.35% coverage variation (-1.00%)
Diff coverage ❌ 73.86% diff coverage (90.00%)

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (1f6699e) 26583 26184 98.50%
Head commit (617a99f) 26928 (+345) 26430 (+246) 98.15% (-0.35%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1534) 153 113 73.86%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@read-the-docs-community

read-the-docs-community Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant