1

How can I implement the "additionalProperties": false, with nestjs/swagger

{
    "properties": {
        "name": {
            "oneOf": [
                {
                    "type": "string"
                },
                {
                    "type": "integer"
                }
            ],
            "additionalProperties": false
        }
    },
    "additionalProperties": false
}```
Alvanxl
  • 150
  • 1
  • 6
  • Can you elaborate on what you are trying to achieve? The provided example does not make much sense because: 1) `additionalProperties` applies to objects only, not to strings or integers; 2) `additionalProperties` is not supposed to be used _alongside_ `allOf`/`oneOf` because `additionalProperties` [has no visibility into subschemas](https://stackoverflow.com/a/22693428/113116). (The latest JSON Schema has the `unevaluatedProperties` keyword for this purpose.) – Helen Dec 15 '21 at 15:29
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 22 '21 at 08:20

0 Answers0