{"record":{"id":"d935868737c7f165","repo":"vllm-project/vllm","slug":"disable-additional-properties-is-only-supported-fo","errorCode":null,"errorMessage":"disable_additional_properties is only supported for the guidance backend.","messagePattern":"disable_additional_properties is only supported for the guidance backend\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/structured_outputs.py","lineNumber":70,"sourceCode":"        graph from input ids/embeddings to the final hidden states,\n        excluding anything before input ids/embeddings and after\n        the final hidden states.\n        \"\"\"\n        # no factors to consider.\n        # this config will not affect the computation graph.\n        factors: list[Any] = []\n        hash_str = safe_hash(str(factors).encode(), usedforsecurity=False).hexdigest()\n        return hash_str\n\n    @model_validator(mode=\"after\")\n    def _validate_structured_output_config(self) -> Self:\n        if self.disable_any_whitespace and self.backend not in (\"xgrammar\", \"guidance\"):\n            raise ValueError(\n                \"disable_any_whitespace is only supported for \"\n                \"xgrammar and guidance backends.\"\n            )\n        if self.disable_additional_properties and self.backend != \"guidance\":\n            raise ValueError(\n                \"disable_additional_properties is only supported \"\n                \"for the guidance backend.\"\n            )\n        return self\n","sourceCodeStart":52,"sourceCodeEnd":75,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/structured_outputs.py#L52-L75","documentation":"StructuredOutputsConfig requires backend='guidance' when disable_additional_properties=True. Injecting additionalProperties:false into JSON schemas is a transformation performed only by the guidance backend's schema pipeline; xgrammar and the other backends pass the schema through and cannot guarantee the constraint. The validator raises immediately at config construction rather than silently ignoring the flag.","triggerScenarios":"Passing disable_additional_properties=True in StructuredOutputsConfig (or the --structured-outputs-config CLI JSON) while backend is unset or set to 'xgrammar'/'outlines'/'lm-format-enforcer'.","commonSituations":"Hardening JSON schemas so models cannot emit undeclared keys, then discovering only guidance supports the rewrite; copying a guidance-tuned config onto an xgrammar deployment; enabling the flag fleet-wide without per-backend feature checks.","solutions":["Set backend='guidance' in the structured outputs config","Disable the flag and instead declare additionalProperties: false explicitly inside each JSON schema you pass to guided_json","Audit request-level schemas and add the constraint in the schema itself if you must keep a non-guidance backend"],"exampleFix":"# before\nstructured_outputs_config = {\"backend\": \"xgrammar\", \"disable_additional_properties\": True}\n# after\nstructured_outputs_config = {\"backend\": \"guidance\", \"disable_additional_properties\": True}","handlingStrategy":"validation","validationCode":"cfg = {\"disable_additional_properties\": True}\nassert not cfg.get(\"disable_additional_properties\") or cfg.get(\"backend\") == \"guidance\", \\\n    \"disable_additional_properties needs guidance backend\"","typeGuard":"def addl_props_ok(cfg: dict) -> bool:\n    return not cfg.get(\"disable_additional_properties\") or cfg.get(\"backend\") == \"guidance\"","tryCatchPattern":null,"preventionTips":["Put additionalProperties:false inside the request schema (guided_json) instead of relying on a global flag when backend varies","Pin backend explicitly whenever backend-conditional flags are set"],"tags":["structured-output","grammar","json-schema","config"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}