apache / apache/servicecomb-java-chassis

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

Đang mở
#3,549 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
1.9k
Fork
814
Merge trung bình
8 ngày 23 giờ
Pull request đã merge (30 ngày)
1

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, spring
Lĩnh vực
api, backend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.