Skip to content

Provide direct access to the validated model for peculiar use cases #31

@edornd

Description

@edornd

There are a lot of options already available, however for any kind of use case it's probably a good idea to also have a way to provide the pydantic model.
A simple concept could be to directly use the function, which (after decoration) is actually a Command instance:

@cli.command()
def foo(value: int):
    print(foo.model)

The idea of storing a reference to the model is not amazing, but I currently don't see drawbacks. It could also be made optional via flag argument, e.g. command(store_config=True), in the future to solve any possible issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions