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

Use of Flux in Webclient dialect #3

Open
dvdeurse opened this issue Dec 3, 2019 · 0 comments
Open

Use of Flux in Webclient dialect #3

dvdeurse opened this issue Dec 3, 2019 · 0 comments

Comments

@dvdeurse
Copy link

dvdeurse commented Dec 3, 2019

Consider the following spec, where we declare a GET that returns a list of items:

/list:
  get:
    tags:
      - Example
    operationId: getExampleList
    responses:
      200:
        description: OK
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Example'

When generating a client for this method, using the WebClient dialect, it results in the following code fragment:

public Mono<List<Example>> getExampleList() {
    ParameterizedTypeReference<List<Example>> typeRef = new ParameterizedTypeReference<List<Example>>(){};
    return invokeAPI("/list", "GET", createUrlVariables(), createQueryParameters(), null).bodyToMono(typeRef);
}

While I would expect the following:

public Flux<Example> getExampleList() {
    return invokeAPI("/list", "GET", createUrlVariables(), createQueryParameters(), null).bodyToFlux(Example.class);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant