code documentation, get value from constant

Viewed 309

Is it possible, that having a constant

 public const string MyString = "myValue"

to get its value "myValue" in xml comments ? I'm interested in this for generating swagger documentation.

    /// <summary>
    /// Creates a new resource.
    /// </summary>
    /// <param name="request">The request object.</param>
    /// <returns code="200">The id of the new resource.</returns>
    /// <response code="400">
    /// <see cref="Errors.BadRequestCodes.MyString"/><para/>
    /// </response>

This is an example of a documented endpoint. And in the swagger ui, instead of seeing the message "myValue" on the 400 status code section I'm actually seeing "Errors.BadRequestCodes.MyString". Is there any way of achieving this?

1 Answers
Related