Skip to content

query params deepObject with additionalProperties: true #2177

Closed

Description

@dankobg

I have this schema:

- name: properties
  in: query
  description: Filter animals by properties
  required: false
  style: deepObject
  schema:
    type: object
    additionalProperties: true

it generates this type:

Properties *map[string]interface{} `json:"properties,omitempty"`

Which is good and basically what i want, but the request validation fails for this url:
animals?properties[vaccinated]=true&properties[color]=black&properties[coat_length]=large
i get error: Invalid format for parameter properties: error assigning value to destination: error binding map: unhandled type: interface {}

If i say:

additionalProperties:
  type: string 

Then it works but the type is *map[string]string and i would manually have to go through jsonschema and loop over properties and convert types from string to bool or whatever. Is there a way to make it work with basically any object, or somehow skip validation for only that specific param?

Activity

  1. mromaszewicz commented on Jul 12, 2026

    @mromaszewicz
    Member
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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions