We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Suppose we have the following interfaces:
export interface FieldFilter { fieldName: string condition: FieldFilterCondition } export interface FieldFilterCondition { type: FieldFilterConditionType invert?: boolean } export enum FieldFilterConditionType { isNull = 'isNull', in = 'in' } export interface FieldFilterConditionIsNull extends FieldFilterCondition { type: FieldFilterConditionType.isNull } export interface FieldFilterConditionIn extends FieldFilterCondition { type: FieldFilterConditionType.in values: Value[] }
Strict check on the following JSON will fail:
{ "fieldName":"SomeFieldName", "condition":{ "type":"in", "values":[ "Some value" ] } }
Error message:
... value.condition.values is extraneous ...
The text was updated successfully, but these errors were encountered:
This sounds like a duplicate of #46
In pure TypeScript, this is also an error:
const cond: FieldFilterCondition = { type: FieldFilterConditionType.in, values: [1, 2] }
That doesn't mean this issue should be dismissed, I even said myself:
this is all hypothetical until an actual user complains
and here we are.
Sorry, something went wrong.
Thank you @alexmojaki for the answer. I think it is very clear why strict check fails - it simply does not know what exact derived type to use here.
The solution I can imagine is to allow defining a type selector for the checker.
No branches or pull requests
Suppose we have the following interfaces:
Strict check on the following JSON will fail:
Error message:
The text was updated successfully, but these errors were encountered: