Skip to content

Validation modes: unknown values silently skip schema validation and silently escalate record validation #433

Description

@zantvoort

Unknown values for the three validation mode properties are handled three different ways; two of them mask a typo (follow-up to #392, which fixed the third):

  1. storm.validation.schema_mode: an unknown value logs a boot warning and skips validation entirely, at both entry points (storm-spring/src/main/java/st/orm/spring/boot/StormValidationAutoConfiguration.java:64, storm-ktor/src/main/kotlin/st/orm/ktor/Storm.kt:403). A deployment that sets schema_mode to a misspelled fail runs with schema validation disabled and only a log line to show for it.
  2. storm.validation.record_mode: only none and warn are special-cased (storm-core/src/main/java/st/orm/core/template/impl/RecordValidation.java:95-99), so any unknown value behaves as fail. Strict by accident: the typo is never reported, it just changes meaning.
  3. storm.validation.interpolation_mode: fails fast naming the valid values since Interpolation safety check: bypassed by one explicit t(), no else on the mode switch, mode name mismatch #392.

All three should fail fast on unknown values with an error naming the property, the given value, and the valid values. Matching normalization applies: the siblings match case-insensitively after trimming, so unknown means unknown after that normalization.

Related detail worth aligning in the same change: blank values diverge. The Spring entry point treats blank schema_mode as the fail default (StormValidationAutoConfiguration.java:52), while the Ktor entry point treats blank as none (Storm.kt:394).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions