Add minLength/maxLength requirements to Inlet
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 196
- Forks
- 34
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 11
Description
After speaking to @kennyweiss , I think we can add a couple verification functions to solve this and make it clear for everyone.
1) An empty, declared array is there so it should not fail verify()
2) Add two new functions called minLength() and maxLength()
@estebanpauli does this work for you?
>
>
> Yea the idea was you would do something like this at the defining part:
>
> ```
> // input file
> Foo = {}
> ```
>
> ```
> // defining schema
> inlet.addIntArray("Foo").required().minLength(1);
> inlet.verify(); // fails due to length 0
> ```
>
> while this would be cover the case you specifically asked for:
>
> ```
> // input file
> Foo = {}
> ```
>
> ```
> // defining schema
> inlet.addIntArray("Foo").required();
> inlet.verify(); // passes
> ```
_Originally posted by @white238 in https://github.com/LLNL/axom/pull/478#discussion_r582403837_
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 Inlet API and its existing verify() behavior, then inspect how array declarations such as addIntArray("Foo") handle required values. Implement and document minLength() and maxLength() so an empty declared array passes required() alone but fails minLength(1), and verify the corresponding boundary cases in the existing Inlet tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100