apache / apache/servicecomb-java-chassis

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

Open
#3,549 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.9k
Forks
814
Avg merge
8d 23h
Merged PRs (30d)
1

Description

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格式的响应正文

Contributor guide

No contributing guide indexed for this repository

Research direction

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.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.