Skip to content

invalid parameter type for enum #25

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

Closed
hauner opened this issue Jun 10, 2023 · 0 comments
Closed

invalid parameter type for enum #25

hauner opened this issue Jun 10, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@hauner
Copy link
Member

hauner commented Jun 10, 2023

openapi: 3.0.0
info:
  title: sample API
  version: 1.0.0

paths:
  /foo:
    get:
      parameters:
        - name: foo-foo
          description: test parameter
          in: query
          required: false
          schema:
            type: string
            enum:
              - foo-1
        - $ref: '#/components/parameters/Bar'
      responses:
        '204':
          description: response


components:
  parameters:

    Bar:
      name: bar-bar
      description: test parameter
      in: query
      required: false
      schema:
        type: string
        enum:
          - bar-1
          - bar-2

generates

package io.openapiprocessor.oap.api;

import io.openapiprocessor.oap.model.Bar-bar;
import io.openapiprocessor.oap.model.Foo-foo;
import io.openapiprocessor.oap.support.Generated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Generated(value = "openapi-processor-spring", version = "2023.3-SNAPSHOT")
public interface Api {

    @GetMapping(path = "/foo")
    void getFoo(
            @RequestParam(name = "foo-foo", required = false) Foo-foo fooFoo,
            @RequestParam(name = "bar-bar", required = false) Bar-bar barBar);

}
@hauner hauner added the bug Something isn't working label Jun 10, 2023
hauner added a commit that referenced this issue Jun 10, 2023
@hauner hauner added this to the 2023.2.1 milestone Jun 14, 2023
hauner added a commit that referenced this issue Jun 14, 2023
(cherry picked from commit 9014b54)
@hauner hauner closed this as completed Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant