Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constraint for the number of results a content element on a page object should return #149

Closed
geb-bot opened this issue Nov 24, 2011 · 0 comments
Labels
Milestone

Comments

@geb-bot
Copy link

@geb-bot geb-bot commented Nov 24, 2011

Originally created by Christoph Neuroth.

As an addition to the "required" constraint, we would like to be able to be more specific about the expected number of results. For example specifying "1 or more" is possible with "required: true" and "0 or more" with "required:false", but it's not currently possible to make sure there is exactly 3 results.

Proposed syntax:

static content = {
  a1(times: 0..1)    {...} // optional, but only once
  a2(min: 0, max: 1) {...} // equivalent

  b1(times: 1..1)    {...} // required, but no more than once
  b2(min: 1, max: 1) {...} // equivalent
  b3(times: 1)       {...} // equivalent

  c1(min: 1)         {...} // required, but can return many
  c2(required: true) {...} // equivalent, current syntax

  d1(min: 3, max: 9) {...} // 3 to 9
  d2(times: 3..9)    {...} // equivalent
@geb-bot geb-bot added the Improvement label Apr 12, 2015
@erdi erdi added this to the 2.0 milestone May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.