1. Javier Garcia Martin
  2. SnapDevelop
  3. Tuesday, 20 February 2024 11:47 AM UTC

Good morning, I have deployed a Webservice for data access using datawindows exported to C#.

I have a question about how to dynamically generate the "documentation" from Snapdevelop with Swagger to deliver to our clients. I have seen how to do it in Swagger itself, but it implies that every time we add a new endpoint to our WS, we have to manually modify the JSON we export to Swagger from SnapDevelop.

In summary, I want to automatically update the information of the WS, the Endpoints, and especially each of the fields, without having to generate a JSON, manipulate it, etc., etc., because this would lead us to make mistakes or lack updated documentation. Is there any possibility to indicate in the fields of the DW the description of each field, so that when I generate the JSON and export it to Swagger, the description of each field, endpoint, etc., is automatically documented?

Thanks

 

 

Attachments (2)
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 20 February 2024 14:51 PM UTC
  2. SnapDevelop
  3. # 1

Hi Javier,

 

I found a way to integrate the documentation written on the endpoints' methods into the Swagger generation, please see the following post: https://stackoverflow.com/a/58633937

You will only have to maintain the documentation on the C# code, and it offers a lot of flexibility. This is how you can write documentation comments on C#: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/

 

I hope this information leads you onto the correct path.

 

Regards,
Francisco

Comment
  1. Javier Garcia Martin
  2. Wednesday, 21 February 2024 08:13 AM UTC
Muchas gracias Francisco.

Pensaba que habría alguna posibilidad de agregar la información en las propias DW. Probé a poner comentarios en la propiedad Description del campo de la tabla de BD por si heredaba de ahí las propiedades, pero no tuve suerte. Probaré la forma de implementar la documentación de la manera que me has comentado.

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.