Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing "Unknown" Record properties are ignored #182

Closed
johngeorgewright opened this issue Dec 16, 2020 · 2 comments
Closed

Missing "Unknown" Record properties are ignored #182

johngeorgewright opened this issue Dec 16, 2020 · 2 comments

Comments

@johngeorgewright
Copy link
Contributor

johngeorgewright commented Dec 16, 2020

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)
@johngeorgewright johngeorgewright changed the title "Unknown" record properties are ignored Missing "Unknown" Record properties are ignored Dec 16, 2020
@yuhr
Copy link
Collaborator

yuhr commented Mar 20, 2021

FWIW a related conversation is here: #113

@yuhr yuhr added the bug label Mar 27, 2021
@yuhr
Copy link
Collaborator

yuhr commented Mar 28, 2021

Resolved in #113, please check it in v5.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants