The Wayback Machine - https://web.archive.org/web/20201217020350/https://github.com/springdoc/springdoc-openapi/issues/985
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

StackOverflowError when using ObjectId with @ParameterObject #985

Closed
ydemartino opened this issue Dec 11, 2020 · 3 comments
Closed

StackOverflowError when using ObjectId with @ParameterObject #985

ydemartino opened this issue Dec 11, 2020 · 3 comments

Comments

@ydemartino
Copy link

@ydemartino ydemartino commented Dec 11, 2020

Describe the bug
I am using an ObjectId with the @ParameterObject, this prevent the doc from being generated and fail with a StackOverflowError. This is the error I got when I applied your suggestions (my User object actually had an ObjectId property).

To Reproduce
Use this HelloController (Kotlin):

@RestController
@RequestMapping("/hello")
class HelloController {

    @GetMapping
    fun hello(@ParameterObject id: ObjectId) {
    }

    @Bean
    fun openApi(): OpenAPI {
        return OpenAPI()
            .schema("ObjectId", Schema<ObjectId>().type("string"))
    }
}

(The schema is not needed to reproduce the issue, but it shows what I was expecting to see)

Expected behavior
Doc is displayed correctly with id as string

Screenshots
Capture d’écran 2020-12-11 à 10 01 47

@ydemartino ydemartino changed the title StackOverflowError when using ObjectId StackOverflowError when using ObjectId with @ParameterObject Dec 11, 2020
@bnasslahsen
Copy link
Contributor

@bnasslahsen bnasslahsen commented Dec 11, 2020

@ydemartino,

Not reproducible.
Provide a Minimal, Reproducible Example - with HelloController that reproduces the problem

If you are reporting a bug, please help to speed up problem diagnosis by at least, reviewing the formatting style when you submit an issue.

This ticket will be now closed and can be reopened if the relevant information is provided.

@ydemartino
Copy link
Author

@ydemartino ydemartino commented Dec 11, 2020

Sorry about the formatting.

How are you not able to reproduce the issue?

I cloned your demo project and changed this line:
https://github.com/springdoc/springdoc-openapi-demos/blob/master/springdoc-openapi-spring-boot-2-webflux/src/main/java/org/springdoc/demo/app3/controller/TweetController.java#L65
with:

	public Flux<TweetDTO> getAllTweets(@ParameterObject ObjectId id) {

And I get the exact same issue

@bnasslahsen
Copy link
Contributor

@bnasslahsen bnasslahsen commented Dec 11, 2020

This issue was not reproducible as your description was incomplete.
Your second try, is a little better.

bnasslahsen added a commit that referenced this issue Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.