springfox: Error when rendering recursively defined models

This error causes the stack to overflow in the ModelAttributeParameterExpander class:

qbj 2eso wr344td igf0

I tried to fix it in my code: if (Types.isBaseType(itemType) || itemType.getErasedType().isEnum()) { parameters.add(simpleFields(context.getParentName(), context.getDocumentationContext(), each)); } else { parameters.addAll( expand( context.childContext( nestedParentName(context.getParentName(), each.getField()), each.getFieldType(), context.getDocumentationContext()))); } }

In addition, because of the large number of my project interface, the project started very slow, compared to 2.5.0 version of a slow slow for a whole minute

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Hello, I think I have the same problem when I use @ModelAttribute in controller …

public String addBook(
    @ModelAttribute Book book, 
    @RequestParam(required = false) String[] authorIds) {
    // ......
}

Entities like:

public class Book {
    private Long id;
    private String name;
    private Set<Author> authors;
    // ... set, get functions
}

public class Author {
    private Long id;
    private String name;
    private List<Book> books;
     // ... set, get functions
}

Is there any solutions for this problem for now ? (except use @RequestBody instead @ModelAttribute) Or can I ignore some properties in entity ?

class A { List<B> bList; } class B{ List<A> aList; }