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: incorrect generic param for multi interfaces #1684

Merged
merged 2 commits into from Jul 30, 2022
Merged

bug: incorrect generic param for multi interfaces #1684

merged 2 commits into from Jul 30, 2022

Conversation

dino-proj
Copy link

public interface CrudControllerBase<S extends Service, SRC extends CustomQuery> {
// some code
}

public interface ExistsControllerBase<S extends Service, EQUERY extends CustomQuery> {

@PostMapping("exist")
default Response exist(@requestbody PostBody req) {
// some code
}

}

@RestController
@RequestMapping("/v1/{tenant_id:[0-9A-Z]+}/user")
public class UserAdminController implements
CrudControllerBase<AdminUserService, AdminUserSearch>,
ExistsControllerBase<AdminUserService, UserExistsQuery> {
// some code
}

the "requestBody" in "/v1/{tenant_id}/user/exist" path get incorrect schema:
"schema": {
"$ref": "#/components/schemas/PostBodyCustomQuery"
}
the correct schema should be:
"schema": {
"$ref": "#/components/schemas/PostBodyUserExistsQuery"
}

public interface CrudControllerBase<S extends Service<?, ?>,  SRC extends CustomQuery> {
    // some code
}

public interface ExistsControllerBase<S extends Service<?, ?>, EQUERY extends CustomQuery> {

@PostMapping("exist")
default Response<Boolean> exist(@requestbody PostBody<EQUERY> req) {
    // some code
}

}

@RestController
@RequestMapping("/v1/{tenant_id:[0-9A-Z]+}/user")
public class UserAdminController implements 
    CrudControllerBase<AdminUserService, AdminUserSearch>,
    ExistsControllerBase<AdminUserService, UserExistsQuery> {
    // some code
}

the "requestBody" in "/v1/{tenant_id}/user/exist" path get incorrect schema: 
    "schema": {
         "$ref": "#/components/schemas/PostBodyCustomQuery"
      }
the correct schema should be:
    "schema": {
         "$ref": "#/components/schemas/PostBodyUserExistsQuery"
      }
@dino-proj
Copy link
Author

dino-proj commented Jun 3, 2022

issue : #1696

@bnasslahsen
Copy link
Contributor

@dino-proj,

Can you update your PR, with the related unit test so it can be merged.

Thank you

@dino-proj
Copy link
Author

@dino-proj,

Can you update your PR, with the related unit test so it can be merged.

Thank you

OK,I Will

@bnasslahsen bnasslahsen merged commit 6868f05 into springdoc:master Jul 30, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants