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
I have an app that is now widely deployed and using the previous version of pydantic-cli.
In the versions before the rewrite for pydantic v2, It was possible to have flags that would automatically be set to True, if they appeared in the commande line instead of relying on validation.
I was thinking of maybe a solution like adding extra kwargs to fields:
in _add_pydantic_field_to_parser(
shape_kw["action"] ="store_true"iffield_info.json_schema_extra.get('store_true', False) else"store"# adds the option to do:ignore_rules: bool=Field(False, description="Ignore rules", cli=('-i', '--ignore-rules'), store_true=True)
I'm not sure if this approach could cause problems
The text was updated successfully, but these errors were encountered:
Hello,
I have an app that is now widely deployed and using the previous version of pydantic-cli.
In the versions before the rewrite for pydantic v2, It was possible to have flags that would automatically be set to True, if they appeared in the commande line instead of relying on validation.
I was thinking of maybe a solution like adding extra kwargs to fields:
in _add_pydantic_field_to_parser(
I'm not sure if this approach could cause problems
The text was updated successfully, but these errors were encountered: