swagger-api / swagger-api/swagger-core

Getting StackOverflowError on ModelResolver

Open
#3,530 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
Dominant language
Java
Stars
7.5k
Forks
2.3k
Avg merge
18h 1m
Merged PRs (30d)
10

Description

Describe the bug

  • I am having a problem trying to load the APIs of my project getting a StackOverflowError.

THIS IS IMPORTANT: This happens to me on a CentOS server, on my local machine it does not happen to me (Windows 10). I do not know if it can be useful to provide the OS information, but just in case.

This is my configuration:

  • pom.xml:
<!-- OpenAPI -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-ui</artifactId>
            <version>1.3.4</version>
        </dependency>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-webmvc-core</artifactId>
            <version>1.3.4</version>
        </dependency>

Swagger-annotations: 2.1.1
Swagger-core: 2.1.1
Swagger-integration: 2.1.1
Swagger-models: 2.1.1

OpenApiConfig.java

@Bean
    public OpenAPI customOpenAPI() {
		Contact contact = new Contact();
		contact.setEmail("XXX");
		contact.setName("XXXX");
		contact.setUrl("XXXX");
		
        return new OpenAPI()
                .components(new Components().addSecuritySchemes("bearer-key",
								new SecurityScheme()
										.type(SecurityScheme.Type.HTTP)
										.scheme("bearer")
										.bearerFormat("JWT"))
				)
				.info(new Info().title("Spring REST OM - XXX")
						.description("XXX API in Swagger framework")
						.contact(contact)
						.version("V.01.00")
				);
    }

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using? <version>2.1.4.RELEASE</version>
  • What modules and versions of springdoc-openapi are you using? Up
  • What is the actual and the expected result using OpenAPI Description (yml or json)? Can't provide.

Expected behavior

  • When I try to enter on swagger-ui.html I'm getting the next:
    image

Screenshots
Log with the error: https://pastebin.com/uggWPPg3

Can someone help me on this, this is urgent :(

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ModelResolver stack trace in the linked log and the dependencies in pom.xml, then review OpenApiConfig.java and the swagger-ui.html entry point. Compare the CentOS and Windows environments and dependency versions; the issue is done when the API loads in Swagger UI without a StackOverflowError.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.