Skip to content

AnnotationsUtils.resolveSchemaFromType does not accept ParameterizedType #458

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
cnusp opened this issue Feb 25, 2020 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@cnusp
Copy link

cnusp commented Feb 25, 2020

Describe the bug
AnnotationsUtils.resolveSchemaFromType cannot be called with a ParameterizedType instance though it is suggested as a replacement for private method ResponseBuilder::calculateSchema(...) in issue 455

To Reproduce

  • Pass ParameterizedType object as first parameter of AnnotationsUtils.resolveSchemaFromType.
  • This leads to Error java: incompatible types: java.lang.reflect.Type cannot be converted to java.lang.Class<?>

Expected behavior
ParameterizedType instance can be passed to AnnotationsUtils.resolveSchemaFromType, as when calling ResponseBuilder::calculateSchema(...).

@bnasslahsen
Copy link
Collaborator

bnasslahsen commented Feb 25, 2020

Hi,

AnnotationsUtils class is related to swagger-core project, and not to springdoc-openapi.
On the post you are mentionning, its indicated you can use SpringDocAnnotationsUtils.extractSchema as well, which supports ParameterizedType.

If you really only want AnnotationsUtils, you can submit your request to the github project of swagger-core instead:

@cnusp
Copy link
Author

cnusp commented Feb 26, 2020

SpringDocAnnotationsUtils is not available outside its package because it is not declared public. Thus its methods cannot be called.

@bnasslahsen
Copy link
Collaborator

SpringDocAnnotationsUtils will be public for the next release: v1.2.33

@bnasslahsen bnasslahsen added the enhancement New feature or request label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants