Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sibren 39 posts 211 karma points c-trib
    Jun 15, 2023 @ 20:15
    Sibren
    0

    How can I add my description and summary to the Swagger-API-description in Umbraco 12?

    So, I'm adding a custom controller in Umbraco 12, with the following code:

    using Microsoft.AspNetCore.Mvc;
    
    namespace MyPersonalBlog.Backend.Controllers
    {
        /// <summary>
        /// This is an awesome controller
        /// </summary>
        [ApiController]
        [Route("[controller]")]
        public class ExampleController : ControllerBase
        {
            /// <summary>
            /// This is my summary for this request
            /// </summary>
            /// <returns>a string</returns>
            [HttpGet]
            [ProducesResponseType(StatusCodes.Status200OK)]
            [ProducesResponseType(StatusCodes.Status500InternalServerError)]
    
            public string ExampleRequest()
            {
                return "Blabla";
            }
        }
    }
    

    How can I get the summary in my swagger?

Please Sign in or register to post replies

Write your reply to:

Draft