Default model example in Swashbuckle (Swagger)

前端 未结 5 1804
再見小時候
再見小時候 2020-12-08 05:22

I\'m running ASP WebAPI 2 and successfully installed Swashbuckle. I am trying to figure out how one defines what the default schema values are?

For example, on the S

5条回答
  •  遥遥无期
    2020-12-08 06:06

    Stumbled across this just now, you can also set the tag in the XML documentation, in one of my models, I have this defined

        /// 
        /// Note content
        /// 
        /// Any text for a note.
        public string Note { get; set; }
    

    which ends up looking like this in the swagger documentation when selecting "Try It Now"

    Hope that helps someone!

提交回复
热议问题