Skip to content

Update to avaje-jsonb 3.0-RC7 with SimpleMapper renamed to JsonMapper #562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aws-cognito/http-client-authtoken/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-json-core</artifactId>
<version>3.0-RC6</version>
<version>3.0-RC7</version>
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-json-node</artifactId>
<version>3.0-RC6</version>
<version>3.0-RC7</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import io.avaje.http.client.AuthTokenProvider;
import io.avaje.http.client.BasicAuthIntercept;
import io.avaje.http.client.HttpClientRequest;
import io.avaje.json.simple.SimpleMapper;
import io.avaje.json.mapper.JsonMapper;

import java.net.http.HttpResponse;
import java.time.Instant;
Expand Down Expand Up @@ -47,7 +47,7 @@ public AuthTokenProvider build() {

private static final class Provider implements AuthTokenProvider {

private static final SimpleMapper MAPPER = SimpleMapper.builder().build();
private static final JsonMapper MAPPER = JsonMapper.builder().build();

private final String url;
private final String clientId;
Expand Down
4 changes: 2 additions & 2 deletions http-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-jsonb</artifactId>
<version>3.0-RC6</version>
<version>3.0-RC7</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-json-node</artifactId>
<version>3.0-RC6</version>
<version>3.0-RC7</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.avaje.http.client;

import io.avaje.http.client.SingleBodyAdapter.JsonBodyAdapter;
import io.avaje.json.simple.SimpleMapper;
import io.avaje.json.mapper.JsonMapper;

import java.util.List;

Expand All @@ -10,7 +10,7 @@ final class DSingleAdapter implements BodyAdapter {

private final ReaderWriter<?> adapter;

static BodyAdapter of(SimpleMapper.Type<?> jsonType) {
static BodyAdapter of(JsonMapper.Type<?> jsonType) {
return new DSingleAdapter(toAdapter(jsonType));
}

Expand All @@ -22,7 +22,7 @@ private DSingleAdapter(JsonBodyAdapter<?> source) {
this.adapter = new ReaderWriter<>(source);
}

private static <T> JsonBodyAdapter<T> toAdapter(SimpleMapper.Type<T> jsonType) {
private static <T> JsonBodyAdapter<T> toAdapter(JsonMapper.Type<T> jsonType) {
return new SimpleJsonAdapter<>(jsonType);
}

Expand Down Expand Up @@ -72,9 +72,9 @@ public BodyContent write(T bean) {

private static final class SimpleJsonAdapter<T> implements JsonBodyAdapter<T> {

private final SimpleMapper.Type<T> jsonType;
private final JsonMapper.Type<T> jsonType;

public SimpleJsonAdapter(SimpleMapper.Type<T> jsonType) {
public SimpleJsonAdapter(JsonMapper.Type<T> jsonType) {
this.jsonType = jsonType;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.avaje.http.client;

import io.avaje.json.simple.SimpleMapper;
import io.avaje.json.mapper.JsonMapper;

/**
* A BodyAdapter that supports converting the request/response body to a single type.
Expand All @@ -25,7 +25,7 @@ static BodyAdapter create(JsonBodyAdapter<?> jsonAdapter) {
* @param jsonType The only type supported to read or write the body content.
* @return The BodyAdapter that the HttpClient can use.
*/
static BodyAdapter create(SimpleMapper.Type<?> jsonType) {
static BodyAdapter create(JsonMapper.Type<?> jsonType) {
return DSingleAdapter.of(jsonType);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.avaje.http.client;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.avaje.json.simple.SimpleMapper;
import io.avaje.json.mapper.JsonMapper;
import org.example.webserver.ErrorResponse;
import org.example.webserver.HelloDto;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -821,9 +821,9 @@ void get_bean_404() {

@Test
void singleBodyAdapter_returningBean() {
var simpleMapper = SimpleMapper.builder().build();
var mapper = JsonMapper.builder().build();

SimpleMapper.Type<HelloDto> type = simpleMapper.type(new HelloDtoAdapter());
JsonMapper.Type<HelloDto> type = mapper.type(new HelloDtoAdapter());
BodyAdapter bodyAdapter = SingleBodyAdapter.create(type);
HttpClient client = client(bodyAdapter);

Expand Down