-
Notifications
You must be signed in to change notification settings - Fork 528
Open
Description
Given a type of
export interface ObjectPartialFieldUpdate {
tags?: Record<string, string | null> | null
}it outputs the following rules
"tags": {"dataType":"union","subSchemas":[{"ref":"Record_string.string-or-null_"},{"dataType":"enum","enums":[null]}]},
where the Record_string.string-or-null_ is of type
"type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"dataType":"string"},"validators":{}},
which is incorrect as it does not allow null values in the record itself
Current workaround is to generate the type as
export interface ObjectPartialFieldUpdate {
tags?: { [key: string]: string | null } | null
}which generates the rule type of
"tags": {"dataType":"union","subSchemas":[{"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"dataType":"union","subSchemas":[{"dataType":"string"},{"dataType":"enum","enums":[null]}]}},{"dataType":"enum","enums":[null]}]},
which allows us to pass the follwoing payload
{
tags: {
test: null
}
}
Metadata
Metadata
Assignees
Labels
No labels