@Test
    public void testOptionalPropsWithEmptyName() {
        var schema = """
                {
                    "properties": {
                        "": {"type": "integer"},
                        "a": {"type": "integer"}
                    },
                    "additionalProperties": {"type": "integer"}
                }
                """;
        var expectedGrammar = """
                -kv ::= "\\"\\"" space ":" space integer
                -rest ::= ( "," space a-kv )? a-rest
                a-kv ::= "\\"a\\"" space ":" space integer
                a-rest ::= ( "," space additional-kv )*
                additional-k ::= ["] ( [a] char+ | [^"a] char* ) ["] space
                additional-kv ::= additional-k ":" space integer
                char ::= [^"\\\\\\x7F\\x00-\\x1F] | [\\\\] (["\\\\bfnrt] | "u" [0-9a-fA-F]{4})
                integer ::= ("-"? integral-part) space
                integral-part ::= [0] | [1-9] [0-9]{0,15}
                root ::= "{" space  (-kv -rest | a-kv a-rest | additional-kv ( "," space additional-kv )* )? "}" 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