Skip to content

Add Codec/JsonCodec, Capability interceptor enrichment, and GraphqlCapability - #3271

Merged
velo merged 6 commits into
masterfrom
codec-capability-interceptor-enrichment
Mar 17, 2026
Merged

velo merged 6 commits into
masterfrom
codec-capability-interceptor-enrichment

Conversation

@velo

@velo velo commented Mar 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Codec/JsonCodec abstractions — Codec pairs an Encoder + Decoder; JsonCodec narrows to JsonEncoder + JsonDecoder. BaseBuilder.codec() sets both at once
  • JsonEncoder marker interface — mirrors the existing JsonDecoder; all JSON encoders (Jackson, Gson, Moshi, Fastjson2, Jackson3) now implement Encoder, JsonEncoder
  • Codec implementations — JacksonCodec, GsonCodec, MoshiCodec, Fastjson2Codec, Jackson3Codec (all Codec, JsonCodec), plus JAXBCodec and SOAPCodec (both Codec) for jaxb/jaxb-jakarta/soap/soap-jakarta
  • Capability interceptor list enrichment — RequestInterceptors/ResponseInterceptors wrapper types; Capability.enrich(RequestInterceptors) and enrich(ResponseInterceptors) allow capabilities to add/remove interceptors. BaseBuilder.enrich() enriches each interceptor individually, then enriches the list as a whole
  • GraphqlCapability — single addCapability() call wires GraphqlContract, GraphqlEncoder, GraphqlDecoder, and GraphqlRequestInterceptor
  • GraphqlEncoder/GraphqlRequestInterceptor separation — encoder no longer implements RequestInterceptor

Usage examples

// Codec shortcut
Feign.builder()
    .codec(new JacksonCodec(mapper))
    .target(MyApi.class, url);

// GraphQL with capability
Feign.builder()
    .addCapability(new GraphqlCapability(new JacksonCodec(mapper)))
    .target(GraphqlApi.class, url);

Test plan

  • All core tests pass (BaseBuilderTest updated for new interceptor enrichment flow)
  • All JSON module tests pass (jackson, gson, moshi, fastjson2, jackson3)
  • GraphQL module tests pass (encoder, client integration)
  • JAXB and SOAP modules compile and tests pass

🤖 Generated with Claude Code

velo added 6 commits March 17, 2026 06:15
…ent, and GraphqlCapability

Signed-off-by: Marvin Froeder <velo.br@gmail.com>
Signed-off-by: Marvin Froeder <velo.br@gmail.com>
Signed-off-by: Marvin Froeder <velo.br@gmail.com>
Signed-off-by: Marvin Froeder <velo.br@gmail.com>
… wrappers

Signed-off-by: Marvin Froeder <velo.br@gmail.com>
Signed-off-by: Marvin Froeder <velo.br@gmail.com>
@velo
velo merged commit a273c6c into master Mar 17, 2026
1 check passed
@velo
velo deleted the codec-capability-interceptor-enrichment branch March 17, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant