You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above gives the following errors Type '"test"' is not assignable to type '"datetime"'. Type '{ test: string; }' is not assignable to type '"json"'.
Next to that, if I do an updateItem action, there is no validation at all and I'm allowed to do the following (which is not correct):
client.request(updateItem('users','test',{endvisit_at: {wrong: 'input'},properties: 'not a json field'}));
To Reproduce
Setup the following Schema with a minimal Directus SDK instance:
Describe the Bug
Up until directus SDK V14 I had the following situation/Schema:
But since SDK V15 the filter checks on string fields became more strict so this
_lte
on a string field is not allowed anymore.So I dived into the docs and found out there are literal types now
datetime
,csv
andjson
.So I changed my Schema to the following:
Victory! Now I'm allowed to use the
_lte
in the filter query again.Let me know if the implementation of this Schema is actually correct 😅
But now the issue, the typing on a
createItem
is expecting a'datetime'
or'json'
type instead of an actual string/object:The above gives the following errors
Type '"test"' is not assignable to type '"datetime"'.
Type '{ test: string; }' is not assignable to type '"json"'.
Next to that, if I do an
updateItem
action, there is no validation at all and I'm allowed to do the following (which is not correct):To Reproduce
Setup the following Schema with a minimal Directus SDK instance:
Try:
which is giving Typescript errors, while the input is correct.
and
which is not giving any errors, while the input is incorrect.
Let me know if any more clarification is needed!
Directus Version
@directus/sdk@15.0.1
Hosting Strategy
Self-Hosted (Docker Image)
The text was updated successfully, but these errors were encountered: