apache / apache/servicecomb-java-chassis

按照示例写springmvc写的xml接口,报argument type mismatch

未关闭
#3,549 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
1.9k
派生
814
平均合并
8 天 23 小时
30 天内合并 PR
1

描述

api:
`@RequestMapping(path = "/aaaa", `
    `method = RequestMethod.POST, `
    `produces = MediaType.APPLICATION_XML_VALUE)`
`public AAA aaaa(@RequestBody AAA aaa) {`
      `return person;`
` }`

入参类:
`@Data`
`@XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)`
`@XmlRootElement(name = "aaa")`
`public class AAA {`
    `@XmlElement(name = "bbb")`
    `private String bbb;`
`}`

postman请求正文:
``
  ``
    `sss`
  ``
``

另写一个无入参的接口,也是返回AAA,在postman那里是可以看到正确的xml格式的响应正文

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start with the Spring MVC endpoint using @RequestBody AAA and the AAA class with JAXB annotations. Reproduce the POST request from Postman with the provided XML, then compare it with the no-argument endpoint that returns XML correctly. Done means the request no longer produces an argument type mismatch and the XML response remains correct.

由索引模型根据 Issue 内容生成。

评估

技术栈
java, spring
领域
api, backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。