Missing "Unknown" Record properties are ignored
johngeorgewright opened this issue · comments
John Wright commented
If you were to create a Record
with 1 Unknown
property, it seems to be ignored during validation:
import { Record, Unknown } from 'runtypes'
const T = Record({ foo: Unknown })
console.info(T.check({}))
// {}
However, static typing would find this an error:
import { Static } from 'runtypes'
const test: Static<typeof T> = {}
// Property 'foo' is missing in type '{}' but required in type '{ foo: unknown; }'. ts(2741)
Sʜɪᴍᴜʀᴀ Yū commented
FWIW a related conversation is here: #113
Sʜɪᴍᴜʀᴀ Yū commented
Resolved in #113, please check it in v5.2.0
.