Skip to content

deepObject with additionalProperties returns unhandled type: map[string]string error #930

@goblindegook

Description

@goblindegook

Hi, I'm getting an error handling requests for the following definition:

openapi: 3.0.0
info:
  title: Example
paths:
  /products:
    get:
      operationId: listProducts
      parameters:
        - name: filter
          in: query
          style: deepObject
          explode: true
          schema:
            type: object
            additionalProperties:
              type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object

The generated type is *map[string]string as expected but handling the request throws an error: unhandled type: map[string]string.

I can see using the debugger that the query string is successfully parsed and fieldPaths seems correct, but it fails in assignPathValues when attempting to write the values to a map, which isn't supported as there is no case for reflect.Map.

This ought to work, and there is a unit test for BindQueryParameter in the codebase that covers a similar scenario, so I'm stumped. What am I missing here?

Thanks in advance!

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