asyncapi / modelina

A library for generating typed models based on inputs such as AsyncAPI, OpenAPI, and JSON Schema documents with high customization
https://modelina.org
Apache License 2.0
300 stars 175 forks source link

C# generator add xml docs from the async api description #1330

Open diogonborges opened 1 year ago

diogonborges commented 1 year ago

Reason/Context

Please try answering few of those questions

Description

Please try answering few of those questions

github-actions[bot] commented 1 year ago

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

jonaslagoni commented 1 year ago

@diogonborges can you give an example model i.e. the output you are looking for?

github-actions[bot] commented 12 months ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

jonaslagoni commented 8 months ago

This issue is similar to how the other languages work in terms of adding descriptions: https://modelina.org/playground?tsIncludeDescriptions=true

This means we have to utilize the functionality of xmldoc: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/?redirectedfrom=MSDN

What we are looking to generate is a description per model and property:

namespace asyncapi.models
{
    using System.Collections.Generic;
    /// <summary>
    /// The light measured payload
    /// </summary>
    public class LightMeasured
    {
        /// <summary>
        /// Id of the streetlight.
        /// </summary>
        private int? id;

        /// <summary>
        /// Light intensity measured in lumens.
        /// </summary>
        private int? lumens;

        /// <summary>
        /// Date and time when the message was sent.
        /// </summary>
        private string? sentAt;

        private Dictionary<string, dynamic>? additionalProperties;

        public int? Id
        {
            get { return id; }
            set { id = value; }
        }

        public int? Lumens
        {
            get { return lumens; }
            set { lumens = value; }
        }

        public string? SentAt
        {
            get { return sentAt; }
            set { sentAt = value; }
        }

        public Dictionary<string, dynamic>? AdditionalProperties
        {
            get { return additionalProperties; }
            set { additionalProperties = value; }
        }
    }
}

We can do this through presets, you can follow this guide to add it: https://github.com/asyncapi/modelina/blob/master/docs/contributing.md#adding-a-new-preset

You can use the following existing description preset for TS as reference: https://github.com/asyncapi/modelina/blob/master/src/generators/typescript/presets/DescriptionPreset.ts

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart: