autorest icon indicating copy to clipboard operation
autorest copied to clipboard

(C#) Summary comments contain improperly escaped backslashes

Open bitsforthought opened this issue 10 years ago • 0 comments

The C# code generator seems to needlessly escape backslashes when generating ///

comments. For example, this Swagger:

        "pattern": {
          "type": "string",
          "default": "\\W+",
          "description": "A regular expression pattern to match token separators. Default is \"\\W+\"."
        },

Yields this code:

        /// <summary>
        /// Gets or sets a regular expression pattern to match token
        /// separators. Default is "\\\\W+".
        /// </summary>
        [JsonProperty(PropertyName = "pattern")]
        public string Pattern { get; set; }

The comment should actually look like this:

        /// <summary>
        /// Gets or sets a regular expression pattern to match token
        /// separators. Default is "\W+".
        /// </summary>

bitsforthought avatar Jun 09 '16 01:06 bitsforthought