V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
unregister
V2EX  ›  程序员

好奇外国人怎么用 swagger 里面的 APIModelProperty 描述的?

  •  
  •   unregister · 2023-02-11 16:16:47 +08:00 · 927 次点击
    这是一个创建于 457 天前的主题,其中的信息可能已经有所发展或是发生改变。

    就比如字段名称 name,难道注解上在加一个 ApiModelProperty(value ="name")在多写一遍吗

    2 条回复    2023-02-11 16:37:50 +08:00
    nothingistrue
        1
    nothingistrue  
       2023-02-11 16:35:45 +08:00   ❤️ 1
    一、ApiModelProperty.value 是可选的。

    二、google style 和 老外的常见 style ,要求得是可选内容如果定义就必须有值,但可以不定义。
    unregister
        2
    unregister  
    OP
       2023-02-11 16:37:50 +08:00
    @nothingistrue 好的谢谢大佬解惑
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1014 人在线   最高记录 6547   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 21:33 · PVG 05:33 · LAX 14:33 · JFK 17:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.