Skip to content

Disallow setting default for files/paths #606

Open

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!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    nextpythonPull requests that update Python codetype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions