Skip to content
New issue

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

[AutoPR] TODO if it's a template, enforce dict structure on ... #132

Open
github-actions bot opened this issue Nov 5, 2023 · 0 comments
Open

[AutoPR] TODO if it's a template, enforce dict structure on ... #132

github-actions bot opened this issue Nov 5, 2023 · 0 comments
Labels

Comments

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2023

TODO if it's a template, enforce dict structure on the template

and issubclass(type_, pydantic.BaseModel)
):
for field_name in type_.__fields__.keys():
if any(field_name in m.__fields__ for m in typing.get_args(add_union)):
raise ValueError(f"{field_name} is a restricted field name.")
# TODO if it's a template, enforce dict structure on the template
type_ = Union[type_, add_union]
template_fields[name_] = (type_, template_field)
inputs_template = pydantic.create_model(
action.id + model.__name__ + "ActionFieldTemplate",
__base__=StrictModel,

To resolve this TODO, you can start by checking if the code is dealing with a template. If it is, you can enforce the dict structure by validating the input data against a predefined template structure.

@github-actions github-actions bot added the medium label Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants