JBoss resteasy - Custom Jackson provider

后端 未结 1 899
挽巷
挽巷 2020-12-12 06:00

I am using JBoss resteasy in my Spring boot application. Have configured with my custom JasonProvider like below and using com.fasterxml.jackson.

    @Provid         


        
相关标签:
1条回答
  • 2020-12-12 06:50

    Adding "application/json" along with the other annotation solved the issue.

    @Provider
    @Consumes({ "application/json","application/*+json", "text/json" })
    @Produces({ "application/json","application/*+json", "text/json" })
    public class JsonProvider extends JacksonJsonProvider {
    

    Spring sets priority based on the match & weightage. Since, the default JsonProvider added the annotation "application/json" in the version 3.1.0, default provider takes precedence and hence adding "application/json" to the custom JsonProvider fixed the issue.

    0 讨论(0)
提交回复
热议问题