0

以下是当前返回并在 Swagger UI 中显示的示例 JSON 字符串的格式。有没有更好的方法来返回格式化的 JSON 字符串并在 UI 上显示而无需显式的字符串替换功能。

"IdentifierDetails": "{\"Id\":\"123456\",\"IdentifiedDate\":\"04/20/2020 1:24:35 PM\",\"Specification\":{\"City\":\"NEWYORK\",\"Country\":\"US\",\"FirstName\":\"Thomas\",\"LastName\":\"Paul\",\"Company\":\"AT&T\",\"InsuranceID\":\"1\2020\4566-7623245\"}}"

预期的:

"IdentifierDetails": "{"Id":"123456","IdentifiedDate":"04/20/2020 1:24:35 PM","Specification":{"City":"NEWYORK","Country":"US","FirstName":"Thomas","LastName":"Paul","Company":"AT&T","InsuranceID":"1\2020\4566-7623245"}}"
4

1 回答 1

0

检查您是否可以将以下内容添加到内容类型并将 json 字符串放在示例中。

mediaType = MediaType.APPLICATION_JSON_VALUE 
于 2020-06-18T06:46:17.640 回答