|
|
憨厚的感冒药 · VSCode ...· 3 月前 · |
|
|
豪爽的豌豆 · 还在为玩不了ChatGPT苦恼?这十几个开源 ...· 2 周前 · |
|
|
知识渊博的铁链 · Debian10 安装Python3.9开发者社区· 2 天前 · |
|
|
非常酷的红茶 · Python3中的“指针” - ...· 5 月前 · |
|
|
英姿勃勃的墨镜 · R语言︱文件读入、读出一些方法罗列(批量xl ...· 1 年前 · |
|
|
孤独的火龙果 · MySQL小表驱动大表 - 秦羽的思考 - 博客园· 2 年前 · |
|
|
谈吐大方的斑马 · 什么控制结构,及如何使用_云原生数据库 ...· 2 年前 · |
|
|
坚强的橙子 · java去除字符串中的空格\t、回车\n、换 ...· 2 年前 · |
我试图在我的springdoc swagger文档中添加示例响应值。
比如用“马克吐温”代替“字符串”等等。
我试过使用这个解决方案- springdoc-openapi: How to add example of POST request?
我已经在课堂上使用
org.springframework.web.bind.annotation.RequestBody
了。
如果我用这个-
@io.swagger.v3.oas.annotations.parameters.RequestBody(content =@Content(示例={ @ExampleObject( name = "Person sample",汇总= "person示例“,value =”[email protected]“,”+ ""firstName":"josh",“+ ""lastName":”spring……“+ "}") })
我没那么过分-
no viable alternative at input ',@io.swagger.v3.oas.annotations.parameters.RequestBody(content=@Content(examples={@ExampleObject(name="Person sample",summary="person example",value="{\"email\": [email protected],"+"\"firstName\": \"josh\","+"\"lastName\": \"spring...\""+"}")})))': NoViableAltException
有人能给我一个解决办法吗?
发布于 2022-03-31 12:33:21
这对我来说很管用
@Schema( type = "string", example = "Clark Kent")
private String name;
https://stackoverflow.com/questions/71661223
复制相似问题
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2023 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号: 粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287