title: How can I pass an object as a query param in URI line?
body: <p>Could you please help me and explain how should I pass an author value?</p>
  
  <pre><code>@GetMapping(value = "/search")
      public ResponseEntity&lt;List&lt;Book&gt;&gt; searchBooksByTitleAndAuthor(
              @RequestParam(value = "title", required = false) final String title,
              @RequestParam(value = "author", required = false) final Author author) {
          HttpStatus httpStatus = HttpStatus.OK;
          List&lt;Book&gt; books = null;
          if (title == null &amp;&amp; author == null) {
              log.info("Empty request");
              httpStatus = HttpStatus.BAD_REQUEST;
          } else if (title == null || author == null) {
              books = bookService.getBooksByTitleOrAuthor(title, author);
          } else {
              Optional&lt;Book&gt; book = bookService.getBookByTitleAndAuthor(title, author);
              if (book.isPresent()) {
                  books = Arrays.asList(book.get());
              }
          }
          if (books == null) {
              return new ResponseEntity&lt;&gt;(httpStatus);
          } else {
              return new ResponseEntity&lt;&gt;(books, httpStatus);
          }
      }
  </code></pre>
  
  <p>And <code>Author</code> class that looks like:</p>
  
  <pre><code>@Entity
  @NoArgsConstructor
  @AllArgsConstructor
  @Getter
  @EqualsAndHashCode
  @ToString
  public final class Author {
  
      @Id
      @GeneratedValue(strategy=GenerationType.IDENTITY)
      private Long id;
  
      private String name;
  
      private LocalDate dateOfBirth;
  
      private String bio;
  }
  </code></pre>
  
  <p>Is it a good approach to use author or @RequestParam instead of request body in this situation? 
  I've thought about requesting only String that is authors' name but it will affect service's methods.</p>