From ddf43fcb6421167a1f3d60e9952908b78a91f65d Mon Sep 17 00:00:00 2001 From: ochafik Date: Wed, 26 Jun 2024 09:19:37 +0100 Subject: [PATCH] Update README.md --- grammars/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/grammars/README.md b/grammars/README.md index 877a7c1ed..75c2b8e1d 100644 --- a/grammars/README.md +++ b/grammars/README.md @@ -199,8 +199,6 @@ Here is also a non-exhaustive list of **unsupported** features: > By default, `object`s accept [additional properties](https://json-schema.org/understanding-json-schema/reference/object#additionalproperties), which you might not want / not expect, and which will make sampling slower (not just because of the extra tokens, but also generates a slower grammar). > You can set `"additionalProperties": false` on the schema of any object to ensure only properties listed in `properties` are generated (not needed for non-`object` types, e.g. `array` or `string`). -#### Python - If you're using [Pydantic](https://pydantic.dev/) to generate schemas, you can disable additional properties with the `extra` config on each model class: ```python @@ -308,8 +306,6 @@ string ::= "\"" char* "\"" space -#### JavaScript - If you're using [Zod](https://zod.dev/), you can make your objects explicitly strict w/ `z.object(...).strict()` or `z.strictObject(...)`. Note however that [zod-to-json-schema](https://github.com/StefanTerdell/zod-to-json-schema) currently always seems to set `"additionalProperties": false` anyway (even w/ zod schemas on which `nonstrict()` / `passthrough()` was called).