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

[Spring] Wrong class path for DeferredResult #6451

Open
sasavilic opened this issue Sep 7, 2017 · 1 comment
Open

[Spring] Wrong class path for DeferredResult #6451

sasavilic opened this issue Sep 7, 2017 · 1 comment

Comments

@sasavilic
Copy link
Contributor

sasavilic commented Sep 7, 2017

Description

Generated code for Spring is using wrong class path for DeferredResult. Currently, it is used org.springframework.web.context.request.DeferredResult, when actual class path is org.springframework.web.context.request.async.DeferredResult. See here.

Fix should be simple, I will provide PR soon.

Swagger-codegen version

2.2.3. This bug is present since corresponding feature is introduced.

Swagger declaration file content or url
Command line used for generation

I am using swagger-codegen-maven-plugin. Here is the configuration

<configuration>
    <inputSpec>${project.basedir}/src/main/spec/api.yaml</inputSpec>
    <language>spring</language>
    <apiPackage>...removed..</apiPackage>
    <modelPackage>...removed...</modelPackage>
    <configOptions>
        <sourceFolder>java</sourceFolder>
        <dateLibrary>java8</dateLibrary>
        <interfaceOnly>true</interfaceOnly>
        <java8>true</java8>
        <responseWrapper>DeferredResult</responseWrapper>
    </configOptions>
    <library>spring-mvc</library>
    <output>${project.build.directory}/generated-sources/server</output>
</configuration>
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

I will provide PR.

@sasavilic sasavilic changed the title Wrong class path for DeferredResult [Spring] Wrong class path for DeferredResult Sep 7, 2017
@sanjaygithu
Copy link

sanjaygithu commented Aug 6, 2021

please add true in

<configOptions> <sourceFolder>/</sourceFolder> <dateLibrary>java8-localdatetime</dateLibrary> <delegatePattern>false</delegatePattern> <interfaceOnly>true</interfaceOnly> <serializableModel>true</serializableModel> <responseWrapper>DeferredResult</responseWrapper> <async>true</async> </configOptions>
add this dependency:
<dependency> <groupId>org.openapitools</groupId> <artifactId>jackson-databind-nullable</artifactId> <version>0.1.0</version> </dependency>

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

2 participants