Disallow setting `default` for files/paths
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 9.5k
- Forks
- 696
- Avg merge
- 7d 19h
- Merged PRs (30d)
- 2
Description
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!)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the validation for Input defaults and the schema generation path for files and paths. Reproduce the default=Path example, then check how a string default is handled. Done means invalid defaults are rejected before producing a schema, with validation covering the affected input types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100