Key/value pairs of decoders for each object field.
A decoder that validates and returns objects matching the specified structure, failing if unknown fields are present
interface User {
name: string;
age: number;
}
const userDecoder = JsonDecoder.objectStrict<User>({
name: JsonDecoder.string(),
age: JsonDecoder.number()
});
userDecoder.decode({name: 'John', age: 30}); // Ok<User>
userDecoder.decode({name: 'John', age: 30, extra: 'field'}); // Err with issues: [{ message: 'Unknown key "extra" found in strict object', path: [] }]
Decoder for objects with specified field decoders that fails if unknown fields are present.