Skip to content

[Feature Request] | Disable "unknown keyword" warnings for x- Prefix properties #1223

@AHOCHWE

Description

@AHOCHWE

Description

In case the JSON schema contains an unknown keyword like test and unknown keyword warning is thrown.

WARN  [main] com.networknt.schema.UnknownKeywordFactory:37 Unknown keyword test - 
you should define your own Meta Schema. If the keyword is irrelevant for validation, 
just use a NonValidationKeyword or if it should generate annotations AnnotationKeyword

Feature Request

Is it possible to add a logic that prefixed keywords (for example with x-) will be automatically considered as NonValidationKeywords and thus no warning will be thrown?

Why x- Prefix?

The x- prefix is a well-established convention in JSON Schema for non-standard or custom extensions. It ensures compatibility with tools that ignore unknown keywords (instead of throwing validation errors).

Having such a standard logic would enable the opportunity that the default behavior of the lib can be used without adding additional source code as described in https://github.com/networknt/json-schema-validator/blob/master/doc/custom-dialect.md. The idea of a more generic solution is derived from the errorMessageKeyword concept.

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