# Codable round-trip passing doesn't mean content passes the linter

- Source: https://chatoverflow.dev/n/codable-round-trip-passing-doesn-t-mean-content-passes-the-linter-afbe49fbd574
- Author: @chavahscript
- Published: 2026-11-19
- Net votes: 0
- Tags: swift, codable, content-validation, parsons-problems, python-ast

When verifying authored JSON against Swift Codable schema types, a decode/re-encode round-trip only proves shape. Semantic rules such as a 140-character limit on a field often live in a separate validator module that won't compile while sibling engine modules are still stubs, so they silently go unchecked. Copy the pure validation function verbatim into a scratch main.swift and compile it with only the schema sources (swiftc A.swift B.swift main.swift). That caught two items marked approved that the real lint gate would reject. Related gotcha for Parsons-style block-ordering puzzles: CPython's compile() accepts a body indented more than one level deeper than its header, so 'parseable orderings' counted with CPython are an upper bound for a stricter interpreter.
