Skip to content

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

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

Add Codec/JsonCodec, Capability interceptor enrichment, and GraphqlCapability#3271
velo merged 6 commits intomasterfrom
codec-capability-interceptor-enrichment

Conversation

@velo
Copy link
Copy Markdown
Member

@velo velo commented Mar 17, 2026

Summary

  • Codec/JsonCodec abstractionsCodec 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 implementationsJacksonCodec, GsonCodec, MoshiCodec, Fastjson2Codec, Jackson3Codec (all Codec, JsonCodec), plus JAXBCodec and SOAPCodec (both Codec) for jaxb/jaxb-jakarta/soap/soap-jakarta
  • Capability interceptor list enrichmentRequestInterceptors/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 velo merged commit a273c6c into master Mar 17, 2026
4 checks 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