Skip to content

2019-09: extractVocabularies trusts all $vocabulary values are booleans #333

Description

@aeschli

Found while reviewing #308 (JSON Schema 2019-09 support).

Problem

extractVocabularies in src/services/jsonSchemaService.ts stores $vocabulary values verbatim:

for (const [uri, required] of Object.entries(metaschema.$vocabulary)) {
    vocabs.set(uri, required);
}

A malformed meta-schema with non-boolean values would flow into isFormatAssertionEnabled (which does return format201909), potentially returning a non-boolean.

Suggested direction

Normalize values with === true (or validate/skip non-boolean entries).

Severity

Low — robustness/edge case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions