Skip to content

Conversation

@IvanPuntev
Copy link
Contributor

@IvanPuntev IvanPuntev commented Nov 20, 2025

Fix #242
Fix #305
Obsolete #306

@IvanPuntev
Copy link
Contributor Author

@SlyngDK Please review.

}

protected Config.FieldConfig fieldConfig(Optional<String> fieldName, Optional<Boolean> enabled) {
protected Config.FieldConfig fieldConfig(String fieldName, Boolean enabled) {
Copy link
Contributor Author

@IvanPuntev IvanPuntev Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using proper types instead of Optional.

return mapper.readValue(getResult(jsonProvider, event), JsonNode.class);
}

protected Config.FieldConfig fieldConfig(Optional<String> fieldName, Optional<Boolean> enabled) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optionals should only be used as a return type.

@Override
public Optional<String> fieldName() {
return fieldName;
return Optional.ofNullable(fieldName);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will return empty optional if input is null.

@Override
public Optional<Boolean> enabled() {
return enabled;
return Optional.ofNullable(enabled);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will return empty optional if input is null.

 # dependency-version: 0.8.14
 # dependency-type: direct:development
 # update-type: version-update:semver-patch
 # dependency-version: 0.8.14
 # dependency-type: direct:production
 # update-type: version-update:semver-patch

 # dependency-version: 3.29.0
 # dependency-type: direct:production
 # update-type: version-update:semver-minor
 # dependency-version: 3.29.0
 # dependency-type: direct:production
 # update-type: version-update:semver-minor
 # dependency-version: 3.29.0
 # dependency-type: direct:production
 # update-type: version-update:semver-minor
 # dependency-version: 3.29.0
 # dependency-type: direct:production
 # update-type: version-update:semver-minor
 # dependency-version: 3.29.0
 # dependency-type: direct:production
 # update-type: version-update:semver-minor
 # dependency-version: 3.29.0
 # dependency-type: direct:development
 # update-type: version-update:semver-minor
  #dependency-version: 3.29.0
 # dependency-type: direct:development
@IvanPuntev IvanPuntev force-pushed the provide-external-jackson-object-mapper branch from 099fc28 to 1f915cc Compare November 21, 2025 11:22
@IvanPuntev
Copy link
Contributor Author

@SlyngDK Should we use a single json factory instance instead of creating new one for each build step?

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a quick look and spotted a few things.

Comment on lines +33 to +36
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
</dependency>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you enforcing Yasson now? It doesn't look like an improvement?

Copy link
Contributor Author

@IvanPuntev IvanPuntev Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The jsonb factory initialization is now moved from the processor to the recorder and it is instantiated only on demand. The dependency is added because the native build starts to break without it.

Error: Discovered unresolved type during parsing: org.eclipse.yasson.internal.JsonBindingBuilder. This error is reported at image build time because class io.quarkiverse.loggingjson.jsonb.JsonbJsonFactory is registered for linking at image build time by command line and command line.

This solution appears to be working but if there is a better / correct way to solve this I will change it.

Comment on lines +8 to +18
@Singleton
public class ObjectMapperProvider {

@Inject
ObjectMapper mapper;

public ObjectMapper get() {
return this.mapper;
}

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt this will work well in practice as you want logging very early, even before ArC is set up.

If you require ArC to be set up to set up logging, it might work but you will collect lots of messages and buffer them in memory before the setup is fully done.

I think you probably need to use the ServiceLoader for this and my guess is that you won't be able to reuse the common ObjectMapper.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to be able to get the object mapper provided from the project including the extension. Don't think the ServiceLoader will do...

Comment on lines -22 to +21
final Config.FieldConfig config = fieldConfig(Optional.empty(), Optional.empty());
final Config.FieldConfig config = fieldConfig(null, null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not a very good idea to mix changes that are not really related to the issue at hand. It makes the PR very verbose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm aware of that but I considered these changes harmless and since there is no frequent activity in this repo decided to include them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants