Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Java: Not able to pass dictionary in query parameters #19019

Open
1 task done
siddhsql opened this issue Jun 25, 2024 · 0 comments
Open
1 task done

[BUG] Java: Not able to pass dictionary in query parameters #19019

siddhsql opened this issue Jun 25, 2024 · 0 comments

Comments

@siddhsql
Copy link

siddhsql commented Jun 25, 2024

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • [ x] Have you validated the input using an OpenAPI validator (example)?
  • [ x] Have you tested with the latest master to confirm the issue still exists?
  • [x ] Have you searched for related issues/PRs?
  • [x ] What's the actual output vs expected output?
  • [ x] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

I want to be able to pass a dictionary in the query params of an endpoint. To do this, I created following spec as example:

- name: metadata
          in: query
          required: false
          style: deepObject
          explode: true
          schema:
            type: object
            additionalProperties:
              type: string      

There are 3 issues (bugs) I am facing:

when I run the openapi-codegenerator (I am running it via Maven plugin) ISSUE 1: it produces the same output irrespective of whether

          style: deepObject
          explode: true

is present or not in the yaml file. The generated Java code is this:

@Parameter(name = "metadata", description = "", in = ParameterIn.QUERY)
          @Valid
          @RequestParam(value = "", required = false)
          Map<String, String> metadata

Further in swagger-ui ISSUE 2: I do not see any UI element corresponding to the metadata variable in above.

I am using openapi: 3.0.1

ISSUE 3: my Spring boot endpoint is like this:

public ResponseEntity<Void> foo(
      String s1, String s2, Map<String, String> map, SomeEnum someEnum) {

Expected: map should not contain s1, s2, someEnum

Observed: map contains s1, s2, someEnum

openapi-generator version

7.4.0

Generation Details
Steps to reproduce
Related issues/PRs

I am not sure if this is same issue as this. Reading that issue it seemed like it is w.r.t. client code whereas my issue is w.r.t. server code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant