Skip to content
Dadata Suggestions API client for Spring (Java)
Java
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci upload code coverage to codacy May 1, 2019
gradle/wrapper First commit. Basic Address suggestion support Apr 28, 2019
src fix tests May 2, 2019
.gitignore First commit. Basic Address suggestion support Apr 28, 2019
README.md Improve docs, change getFindByIdSuggestionPrefix to String May 2, 2019
build.gradle 1.0.0 release May 2, 2019
gradlew First commit. Basic Address suggestion support Apr 28, 2019
gradlew.bat
lombok.config add lombok config May 1, 2019
settings.gradle - change packages May 1, 2019

README.md

Release CircleCI Codacy Badge codecov

dadata-client

Dadata Suggestions API client for Spring (Java)

Overview

Dadata API client based on non-blocking HTTP client of Spring WebClient. Supports all methods of Suggestion API

Add a dependency

Gradle:

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
        implementation 'com.github.kuliginstepan:dadata-client:Tag'
}

Maven:

<repositories>
	<repository>
	    <id>jitpack.io</id>
	    <url>https://jitpack.io</url>
	</repository>
</repositories>

Step 2. Add the dependency

<dependency>
    <groupId>com.github.kuliginstepan</groupId>
    <artifactId>dadata-client</artifactId>
    <version>Tag</version>
</dependency>

Usage

You need to add property dadata.client.token with your Dadata API Token. You may add property dadata.client.timeout to configure dadata client request timeout.

Dadata client provides DadataClientAutoConfiguration which configures DadataClient bean for you.

Autowire DadataClient in your beans and call api methods, for example:

@Service
public class SomeService {
    
    @Autowired
    private DadataClient client;
    
    public Flux<Suggestion<Address>> getSuggestionsForAddress(String query) {
        return client.suggestAddress(AddressRequestBuilder.create(query).build());
    }
}

Request builders allow to filter and rank suggestions. More examples are available in the test module

You can’t perform that action at this time.