Skip to content

Conversation

@ChristianLohmann
Copy link
Member

This pull request introduces two new modules, logbook-json-common and logbook-json-jackson2, to modularize and share JSON-related functionality. It updates dependencies and refactors code to use these new modules, improving maintainability and preparing for support of multiple JSON implementations.

Module introduction and dependency updates:

  • Added new Maven modules: logbook-json-common (for shared JSON utilities) and logbook-json-jackson2 (for Jackson 2-specific JSON handling). [1] [2]
  • Updated logbook-bom/pom.xml and logbook-jmh/pom.xml to include dependencies on the new modules. [1] [2]

Code refactoring for new modules:

  • Moved common JSON utility classes from logbook-json to logbook-json-common and updated imports accordingly. [1] [2] [3] [4] [5] [6]
  • Refactored benchmark code in HttpLogFormatterState to use FastJsonHttpLogFormatterJackson2 instead of the previous FastJsonHttpLogFormatter, aligning with the new modular structure. [1] [2]
  • Updated usage of JsonPathBodyFilters in benchmarks to reference the correct class after modularization.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All commits are signed

@ChristianLohmann ChristianLohmann force-pushed the jackson-3-separate-module branch from 1841120 to 83b41d1 Compare December 31, 2025 11:11
@ChristianLohmann ChristianLohmann added the architectural New features and architectural changes, e.g. framework changes, migrations, rollout of new services. label Dec 31, 2025
Copy link
Member

@kasmarian kasmarian left a comment

Choose a reason for hiding this comment

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

I think it's also worth updating README and explaining how/when to use each of the modules.

// Try Jackson 3 first when explicitly requested
Class.forName("tools.jackson.core.json.JsonFactory");
return new ParsingJsonCompactor();
} catch (final ClassNotFoundException e) {
Copy link
Member

Choose a reason for hiding this comment

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

This catch doesn't make sense any more as it's now trying to initialize a class, that's not in the classpath. Before it was used to fallback to jackson2, as this is a static method.

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

Labels

architectural New features and architectural changes, e.g. framework changes, migrations, rollout of new services.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants