From 2547526292ef1a7bc7bfcd00cba588a976b76b0a Mon Sep 17 00:00:00 2001 From: kellystar999 Date: Fri, 10 Sep 2021 13:51:06 +1200 Subject: [PATCH] Add XML comment list example In response to https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/1629#issuecomment-915384316 --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4bd9dc6b..0804d1a1 100644 --- a/README.md +++ b/README.md @@ -512,16 +512,16 @@ To enhance the generated docs with human-friendly descriptions, you can annotate /// /// Awesomeness! /// The product id - /// Product created - /// Product has missing/invalid values - /// Oops! Can't create your product right now + /// Product retrieved + /// Product not found + /// Oops! Can't lookup your product right now [HttpGet("{id}")] [ProducesResponseType(typeof(Product), 200)] - [ProducesResponseType(typeof(IDictionary), 400)] + [ProducesResponseType(404)] [ProducesResponseType(500)] public Product GetById(int id) ``` - + 4. You can also annotate types with summary and example tags: ```csharp @@ -538,6 +538,12 @@ To enhance the generated docs with human-friendly descriptions, you can annotate /// /// 10 public int AvailableStock { get; set; } + + /// + /// The sizes the product is available in + /// + /// ["Small", "Medium", "Large"] + public List Sizes { get; set; } } ```