spring-projects / spring-projects/spring-security

When possible use SmartHttpMessageConverter over GenericHttpMessageConverter

Open
#18,073 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: enhancement
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Spring Security often uses GenericHttpMessageConverter for JSON support. The new Jackson support was refined to be a SmartHttpMessageConverter, so we should refine our usage to leverage SmartHttpMessageConverter when possible. Here are a few places that are using GenericHttpMessageConverter:

  • config/src/main/java/org/springframework/security/config/web/server/HttpMessageConverters.java
  • oauth2/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/http/converter/HttpMessageConverters.java
  • oauth2/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/oidc/http/converter/HttpMessageConverters.java
  • oauth2/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/HttpMessageConverters.java
  • oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/web/OAuth2ProtectedResourceMetadataFilter.java

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the five listed HttpMessageConverters.java files and OAuth2ProtectedResourceMetadataFilter.java to see where GenericHttpMessageConverter is used. Check the available SmartHttpMessageConverter support in the Spring Security and Jackson integration points, then verify that each applicable usage leverages it without changing existing JSON conversion behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, security
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.