apache / apache/servicecomb-java-chassis

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

Aperta
#3,549 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
1.9k
Fork
814
Merge medio
8g 23h
PR unite (30g)
1

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, spring
Ambito
api, backend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.