interagent / interagent/committee
string with format: date not working
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 955
- Forks
- 145
- Avg merge
- 5d 4h
- Merged PRs (30d)
- 6
Description
Hi,
I'm trying to validate requests using request validation middleware. In one of my API, I'm using following rule for one of my query params in API.
{
"name" : "from_date",
"in" : "query",
"schema" : {
"type" : "string",
"format" : "date",
"example" : "2017-09-24"
}
}
As per, this rule request should fail if passed value is not a valid date but it's not failing if I pass from_date=abc.
If I update format to date-time and then if I pass from_date=abc then it's giving me error as expected.
Request should fail if format is date and I pass from_date=abc.
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 at the request validation middleware and the schema format handling for query parameters. Reproduce the issue with the provided schema using from_date=abc, then compare the date and date-time paths. Done means an invalid value for format date is rejected with a validation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100