In the previous post, I introduced Swagger and showed how to set up your project for Swagger. In this post I will show how to add Swagger comments to annotate your program.
In earlier posts we looked at the database of cars and the Get method that retrieves the entire list. That can be quite a lot of data going over the wire. What we want instead is to send pages. I’ll show that briefly and then we’ll annotate that code.
In the CarController we’ll have a Get method that takes three parameters: showDeleted, pageNumber and pageSize. The first we’ve seen before, it determines whether the list returned to the caller will include our deleted records. The second, pageNumber, will designate which page of data we want to return (zero based). The third parameter, pageSize, will designate how many records to return per page.
Thus, if we were to write
Get(false,3,4)
we would expect to get back records 17, 18, 19 and 20, because page 0 would have records 1-4, page 1 would have 5-8, etc.
Here is the compete endpoint that will directly call our repository (we won’t bother with a service for this example).
public async Task<IEnumerable<Car>> Get([FromRoute] bool showDeleted, int pageNumber, int pageSize )
{
return await _carRepository.Get(showDeleted, pageNumber, pageSize);
}
When the repository is called, the parameters are passed in, and it does its magic. For now, however, we are only concerned with documenting this method. We do that with XML comments, designated by three forward slash marks (///).
First, we will document the purpose of the endpoint; that is, what it does. We do that in the summary
/// <summary>
/// Get all the cars in the Database
/// </summary>
Next, we want to document the parameters
/// <param name="returnDeletedRecords">If true, the method will return all the records,
/// including the ones that have been deleted</param>
/// <param name="pageOffset">which page to display</param>
/// <param name="pageSize">how many records to display per page</param>
Finally, I’m going to document the possible response codes. Note, these are, by no means, all that you can document, but they’ll give us a good idea of how it is done
/// <response code="200">Cars returned</response>
/// <response code="404">Specified Car not found</response>
/// <response code="500">An Internal Server Error prevented the request from being executed.</response>
When an error is encountered and we return one of these codes, the text we’ve specified goes along for the ride, which is enormously helpful to the calling client.
At the top of the swagger page is our summary

At each parameter is our designated text

Finally, each of the error codes is documented

It is a best practice to document all of the endpoints. Many developers go further, and document all of the methods in both the service and the repository; that is a decision to be made by the team. Since the endpoint is the only thing visible to the client, it has the greatest claim on your time and effort. Remember, “comments rust,” and that is as true for Swagger comments as any other.






































analyticsreport – Color palette felt calming, nothing distracting, just focused, thoughtful design.
Thank you, I have just been looking for info about this topic for a long time and yours is the best I’ve discovered till now. However, what about the conclusion? Are you positive in regards to the supply?
viagraonline2
Great addition to the series. I’ve found that taking the time to write good Swagger comments not only helps others understand my API, but it forces me to think more clearly about my own design decisions. It’s documentation that pays for itself.
Great post, Jesse. Adding meaningful Swagger comments has been a game-changer for our team’s onboarding process. It really does turn the API documentation from a simple reference into a practical guide. I’m curious, do you have a preferred approach for keeping these XML comments in sync as the API evolves?
The program works with multiple file systems, including UDF, which is often used for data storage on DVDs. Image Creation, This tool can browse for data from severely damaged discs and create an image file suitable for data recovery purposes. Handling Image Discs, Even if a disk has been extracted, RepairCDDVD can recover the information contained within it. Support for Other Media, Besides the CD/DVD disks, this application can also recover data from several other types of media. ISO Format Conversion, It allows users to make copies of virtual disks (ISO images), which can be recovered later without any hindrance. Portable Version Available, RepairCDDVD can also be used as a portable utility that can be taken to different computers without being installed. Speed and Usability, The program boasts an intuitive interface and fast algorithms that allow straightforward scanning and recovering of data. If you need to recover information from a CD or DVD, RepairCDDVD is certainly worth trying.
The program works with multiple file systems, including UDF, which is often used for data storage on DVDs. Image Creation, This tool can browse for data from severely damaged discs and create an image file suitable for data recovery purposes. Handling Image Discs, Even if a disk has been extracted, RepairCDDVD can recover the information contained within it. Support for Other Media, Besides the CD/DVD disks, this application can also recover data from several other types of media. ISO Format Conversion, It allows users to make copies of virtual disks (ISO images), which can be recovered later without any hindrance. Portable Version Available, RepairCDDVD can also be used as a portable utility that can be taken to different computers without being installed. Speed and Usability, The program boasts an intuitive interface and fast algorithms that allow straightforward scanning and recovering of data. If you need to recover information from a CD or DVD, RepairCDDVD is certainly worth trying.
The program works with multiple file systems, including UDF, which is often used for data storage on DVDs. Image Creation, This tool can browse for data from severely damaged discs and create an image file suitable for data recovery purposes. Handling Image Discs, Even if a disk has been extracted, RepairCDDVD can recover the information contained within it. Support for Other Media, Besides the CD/DVD disks, this application can also recover data from several other types of media. ISO Format Conversion, It allows users to make copies of virtual disks (ISO images), which can be recovered later without any hindrance. Portable Version Available, RepairCDDVD can also be used as a portable utility that can be taken to different computers without being installed. Speed and Usability, The program boasts an intuitive interface and fast algorithms that allow straightforward scanning and recovering of data. If you need to recover information from a CD or DVD, RepairCDDVD is certainly worth trying.
The program works with multiple file systems, including UDF, which is often used for data storage on DVDs. Image Creation, This tool can browse for data from severely damaged discs and create an image file suitable for data recovery purposes. Handling Image Discs, Even if a disk has been extracted, RepairCDDVD can recover the information contained within it. Support for Other Media, Besides the CD/DVD disks, this application can also recover data from several other types of media. ISO Format Conversion, It allows users to make copies of virtual disks (ISO images), which can be recovered later without any hindrance. Portable Version Available, RepairCDDVD can also be used as a portable utility that can be taken to different computers without being installed. Speed and Usability, The program boasts an intuitive interface and fast algorithms that allow straightforward scanning and recovering of data. If you need to recover information from a CD or DVD, RepairCDDVD is certainly worth trying.
This is really fascinating, You’re an overly professional blogger.
I’ve joined your rss feed and look forward to seeking extra of your fantastic post.
Additionally, I’ve shared your web site in my social
networks
RepairCdDvD v2.7 is a software tool designed to retrieve data from scratched or damaged CDs and DVDs, including formats such as CD+R/RW and DVD+R/RW, BD.
https://repaircddvd.com
RepairCdDvD v2.7 is a software tool designed to retrieve data from scratched or damaged CDs and DVDs, including formats such as CD+R/RW and DVD+R/RW, BD.
https://repaircddvd.com
RepairCdDvD v2.7 is a software tool designed to retrieve data from scratched or damaged CDs and DVDs, including formats such as CD+R/RW and DVD+R/RW, BD.
RepairCdDvD v2.7 is a data recovery tool designed for recovering information from damaged CD and DVD media, effectively restoring data from corrupted DVDs. This software proves very helpful in cases when discs are scratched or poorly recorded. The operations of the program are performed without any risk, and the process of disk repair is carried out by means of an ISO image.
https://repaircddvd.com
Аренда оборудования для чистоты, переходите <a href=
https://www.beststroy.ru/catalog/286/1027/1_1.html
RepairCdDvD v2.7 is a software tool designed to retrieve data from scratched or damaged CDs and DVDs, including formats such as CD+R/RW and DVD+R/RW, BD.
เนื้อหานี้ อ่านแล้วเข้าใจง่าย ครับ
ดิฉัน ไปอ่านเพิ่มเติมเกี่ยวกับ ข้อมูลเพิ่มเติม
ที่คุณสามารถดูได้ที่
Azucena
น่าจะถูกใจใครหลายคน
มีตัวอย่างประกอบชัดเจน
ขอบคุณที่แชร์ ข้อมูลที่มีประโยชน์ นี้
และหวังว่าจะได้เห็นโพสต์แนวนี้อีก
WebSite: https://repaircddvd.com
RepairCdDvD v2.7 is a data recovery tool designed for recovering information from damaged CD and DVD media, effectively restoring data from corrupted DVDs. This software proves very helpful in cases when discs are scratched or poorly recorded. The operations of the program are performed without any risk, and the process of disk repair is carried out by means of an ISO image.
WebSite: https://repaircddvd.com
บทความนี้ น่าสนใจดี ครับ
ผม ได้อ่านบทความที่เกี่ยวข้องกับ ข้อมูลเพิ่มเติม
ดูต่อได้ที่ Eden
สำหรับใครกำลังหาเนื้อหาแบบนี้
เพราะอธิบายไว้ละเอียด
ขอบคุณที่แชร์ ข้อมูลที่มีประโยชน์ นี้
และอยากเห็นบทความดีๆ แบบนี้อีก
admark – Overall, professional vibe here; trustworthy, polished, and pleasantly minimal throughout.
RepairCdDvD v2.7 is a software tool designed to retrieve data from scratched or damaged CDs and DVDs, including formats such as CD+R/RW and DVD+R/RW, BD.
RepairCdDvD v2.7 is a data recovery tool designed for recovering information from damaged CD and DVD media, effectively restoring data from corrupted DVDs. This software proves very helpful in cases when discs are scratched or poorly recorded. The operations of the program are performed without any risk, and the process of disk repair is carried out by means of an ISO image.
RepairCdDvD v2.7 is a data recovery tool designed for recovering information from damaged CD and DVD media, effectively restoring data from corrupted DVDs. This software proves very helpful in cases when discs are scratched or poorly recorded. The operations of the program are performed without any risk, and the process of disk repair is carried out by means of an ISO image.
RepairCdDvD v2.7 is a software tool designed to retrieve data from scratched or damaged CDs and DVDs, including formats such as CD+R/RW and DVD+R/RW, BD.
RepairCdDvD v2.7 is a data recovery tool designed for recovering information from damaged CD and DVD media, effectively restoring data from corrupted DVDs. This software proves very helpful in cases when discs are scratched or poorly recorded. The operations of the program are performed without any risk, and the process of disk repair is carried out by means of an ISO image.
WebSite: https://repaircddvd.com
https://repaircddvd.com
RepairCdDvD v2.7 is a software tool designed to retrieve data from scratched or damaged CDs and DVDs, including formats such as CD+R/RW and DVD+R/RW, BD.
RepairCdDvD v2.7 is a data recovery tool designed for recovering information from damaged CD and DVD media, effectively restoring data from corrupted DVDs. This software proves very helpful in cases when discs are scratched or poorly recorded. The operations of the program are performed without any risk, and the process of disk repair is carried out by means of an ISO image.
https://repaircddvd.com
RepairCdDvD v2.7 is a software tool designed to retrieve data from scratched or damaged CDs and DVDs, including formats such as CD+R/RW and DVD+R/RW, BD.
https://repaircddvd.com
RepairCdDvD v2.7 is a software tool designed to retrieve data from scratched or damaged CDs and DVDs, including formats such as CD+R/RW and DVD+R/RW, BD.
RepairCdDvD v2.7 is a data recovery tool designed for recovering information from damaged CD and DVD media, effectively restoring data from corrupted DVDs. This software proves very helpful in cases when discs are scratched or poorly recorded. The operations of the program are performed without any risk, and the process of disk repair is carried out by means of an ISO image.
RepairCdDvD v2.7 is a software tool designed to retrieve data from scratched or damaged CDs and DVDs, including formats such as CD+R/RW and DVD+R/RW, BD.
WebSite: https://repaircddvd.com
https://repaircddvd.com
RepairCdDvD v2.7 is a data recovery tool designed for recovering information from damaged CD and DVD media, effectively restoring data from corrupted DVDs. This software proves very helpful in cases when discs are scratched or poorly recorded. The operations of the program are performed without any risk, and the process of disk repair is carried out by means of an ISO image.
You’re so cool! I do not believve I’ve ead a single
thing like this before. So great to find someone with a few unique thoughts
on this issue. Really.. many thanks for starting this up.
This site is something that is needed on the web, someone with a
bit of originality!
My blog diyarbakır escort bayan
WebSite: https://repaircddvd.com
https://repaircddvd.com
https://repaircddvd.com
RepairCdDvD v2.7 is a software tool designed to retrieve data from scratched or damaged CDs and DVDs, including formats such as CD+R/RW and DVD+R/RW, BD.
Great addition to the series. I’ve found that taking the time to write thorough Swagger comments has dramatically improved the onboarding experience for new developers on our team. It forces you to think about the API from the consumer’s perspective.
Looking well creates a positive first impression.
Your attire communicates volumes before a person even say a single word.
This enhances your personal self-esteem and mood significantly.
Your polished appearance signals competence in the office.
https://style.balmain1.ru/rol-demny-gvasaliya-v-razvitii-ulichnoy-mody-6154394/
Fashionable clothing let you to express your individual personality.
Others often perceive stylish individuals as more successful and reliable.
Ultimately, investing in your wardrobe is an investment in yourself.
RepairCdDvD v2.7 is a software tool designed to retrieve data from scratched or damaged CDs and DVDs, including formats such as CD+R/RW and DVD+R/RW, BD.