Skip to content

Setting additionalProperties: false (or true) causes TypeMismatchException #370

Closed

Description

@tedberg

When you want to add additionalProperties using object notation, it works fine. We can even explicitly state that they are allowed, even though that is the default by setting additionalProperties: {}.

If we want to block allowing unknown properties in a request, the convention is additionalProperties: false. However if we set it to a boolean, the following exception is thrown during generation:

io.openapiprocessor.jsonschema.converter.TypeMismatchException: property '/components/schemas/Movie/additionalProperties' is not a java.util.Map
    at io.openapiprocessor.jsonschema.schema.Bucket.getBucket (Bucket.java:163)
    at io.openapiparser.Properties.getObjectOrNull (Properties.java:204)
    at io.openapiparser.Properties.getObjectOrNull (Properties.java:132)
    at io.openapiparser.model.v31.Schema.getAdditionalProperties (Schema.java:160)
    at io.openapiprocessor.core.parser.openapi.v31.Schema.getAdditionalProperties (Schema.kt:77)
    at io.openapiprocessor.core.parser.openapi.v31.Schema.getAdditionalProperties (Schema.kt:15)
    at io.openapiprocessor.core.converter.SchemaInfo.buildForAdditionalProperties (SchemaInfo.kt:368)

We can see an example of false being set here: https://spec.openapis.org/oas/3.0/schema/2024-10-18.html. or here https://www.apimatic.io/openapi/additionalproperties

Activity

  1. added this to the 2026.3 milestone on Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions