Skip to content

Is there a way to automatically include <summary> comments in the swagger output? #119

Open
@MartinWickman

Description

@MartinWickman

It's a bit of a hassle having to maintain both the /// comments and the OpenApiOperation[] annotation.

This is fair for the actual operations, but becomes more of a struggle with domain objects that are returned which may have lots of properties which are already documented properly in the documentation comments. Is it possible to somehow extract the <summary> text and have it used by default?

public class Person
    {
        /// <summary>
        /// Lorem ipsum dolor sit amet, consectetur adipiscing elit...
        /// </summary>
        [OpenApiPropertyDescription("Lorem ipsum dolor sit amet, consectetur adipiscing elit...")]
        public string? FirstName { get; set; }

        /// <summary>
        /// Lorem ipsum dolor sit amet, consectetur adipiscing elit...
        /// </summary>
        [OpenApiPropertyDescription("Lorem ipsum dolor sit amet, consectetur adipiscing elit...")]
        public string? LastName { get; set; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions