grammar : handle maxItems == 0 in JSON schema (#13117)
Co-authored-by: Richard Lyons <frob@cloudstaff.com>
This commit is contained in:
parent
295354ea68
commit
d5fe4e81bd
4 changed files with 25 additions and 0 deletions
|
@ -10,6 +10,9 @@ from typing import Any, List, Optional, Set, Tuple, Union
|
|||
|
||||
def _build_repetition(item_rule, min_items, max_items, separator_rule=None):
|
||||
|
||||
if max_items == 0:
|
||||
return ""
|
||||
|
||||
if min_items == 0 and max_items == 1:
|
||||
return f'{item_rule}?'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue