Skip to content

Disallow setting default for files/paths #606

Open
@bfirsh

Description

@bfirsh

For example, this ain't gonna work:

def predict(self, file: Path = Input(default=Path("image.png")):

The thing consuming the schema (e.g. Replicate) can't get that default. We should just not allow this until we've figured out a better solution here.

As an aside: just setting the default to string is allowed but shouldn't be. Maybe we should validate default values to check they're actually the correct type.

Reported by @yael-vinker (thank you!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions