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
Currently there are two ways to validate arguments given to actions
Using JSON schema validation (which is alright)
parameterized function, which is a little verbose.
Best is to use type annotations as much as possible. Its succint & mostly understandable.
There is an implementation in labthings-fastapi. Once the GPL related license details are sorted out, it can be carried over.
Its also better to describe actions using objects instead of a descriptor. One may have to create an Action class, which are instantiated for each action.
Regarding property models, many are comfortable using pydantic based models which will also offer a different type of flexibility compared to param. This should be supported. Code is already there in labthings-fastapi.
The text was updated successfully, but these errors were encountered:
Currently there are two ways to validate arguments given to actions
Best is to use type annotations as much as possible. Its succint & mostly understandable.
There is an implementation in labthings-fastapi. Once the GPL related license details are sorted out, it can be carried over.
Its also better to describe actions using objects instead of a descriptor. One may have to create an
Action
class, which are instantiated for each action.Regarding property models, many are comfortable using
pydantic
based models which will also offer a different type of flexibility compared toparam
. This should be supported. Code is already there in labthings-fastapi.The text was updated successfully, but these errors were encountered: