@Test
    public void testMinAndMaxItems() {
        var schema = """
                {
                    "items": {
                        "type": ["number", "integer"]
                    },
                    "minItems": 3,
                    "maxItems": 5
                }
                """;
        var expectedGrammar = """
                decimal-part ::= [0-9]{1,16}
                integer ::= ("-"? integral-part) space
                integral-part ::= [0] | [1-9] [0-9]{0,15}
                item ::= number | integer
                number ::= ("-"? integral-part) ("." decimal-part)? ([eE] [-+]? integral-part)? space
                root ::= "[" space item ("," space item){2,4} "]" space
                space ::= | " " | "\\n" [ \\t]{0,20}
                """;

        var actualGrammar = JsonSchemaToGrammar.convert(schema);
        assertEquals(expectedGrammar, actualGrammar);
    }
These tests are based on C++ unit tests from llama.cpp repository.
model-integration/src/test/java/ai/vespa/llm/clients/JsonSchemaToGrammarTest.java