Skip to content

Commit

Permalink
chore: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mlz11 committed Dec 28, 2023
1 parent 10ae642 commit 042c4fe
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Please note that providing such a feature on your API does not come without risk
<!-- GETTING STARTED -->
## Getting Started

**Requirements** : JDK 8 or more.
**Requirements** : JDK 17 or more.
To get a local copy up and running follow these simple steps.

### Installation
Expand All @@ -91,7 +91,7 @@ Add the repo to your project inside your `pom.xml` file
<dependency>
<groupId>com.sipios</groupId>
<artifactId>spring-search</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
</dependency>
```

Expand Down Expand Up @@ -175,6 +175,40 @@ Request : `/cars?search=options.transmission:Auto`
Request : `/cars?search=creationyear:2018 AND price<300000 AND (color:Yellow OR color:Blue) AND options.transmission:Auto`
![complex example](./docs/images/complex-example.gif)

<!-- TROUBLESHOOTING -->
## Troubleshooting

If you get the following error ⬇️

> No primary or default constructor found for interface org.springframework.data.jpa.domain.Specification
You are free to opt for either of the two following solutions :
1. Add a `@Configuration` class to add our argument resolver to your project
```kotlin
// Kotlin
@Configuration
class SpringSearchResolverConf : WebMvcConfigurer {
override fun addArgumentResolvers(argumentResolvers: MutableList<HandlerMethodArgumentResolver>) {
argumentResolvers.add(SearchSpecificationResolver())
}
}
```
```java
// Java
@Configuration
public class SpringSearchResolverConf implements WebMvcConfigurer {
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
argumentResolvers.add(new SearchSpecificationResolver());
}
}
```

2. Add a `@ComponentScan` annotation to your project configuration class
```java
@ComponentScan(basePackages = {"com.your-application", "com.sipios.springsearch"})
```

<!-- ROADMAP -->
## Roadmap

Expand Down

0 comments on commit 042c4fe

Please sign in to comment.