Skip to content

Instantly share code, notes, and snippets.

@mmacy
Created February 7, 2019 23:09
Show Gist options
  • Save mmacy/9c66a2d150520903d828b4f95ea8c61b to your computer and use it in GitHub Desktop.
Save mmacy/9c66a2d150520903d828b4f95ea8c61b to your computer and use it in GitHub Desktop.

Current AutoRest output

This is the current code generated by AutoRest for the AdminUserName property:

/// <summary>
/// Gets or sets specifies the name of the administrator account.
/// &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; **Windows-only restriction:**
/// Cannot end in "." &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; **Disallowed
/// values:** "administrator", "admin", "user", "user1", "test",
/// "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser",
/// "adm", "admin2", "aspnet", "backup", "console", "david", "guest",
/// "john", "owner", "root", "server", "sql", "support",
/// "support_388945a0", "sys", "test2", "test3", "user4", "user5".
/// &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; **Minimum-length (Linux):** 1
/// character &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; **Max-length
/// (Linux):** 64 characters &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
/// **Max-length (Windows):** 20 characters
/// &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;li&amp;gt; For root
/// access to the Linux VM, see [Using root privileges on Linux virtual
/// machines in
/// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)&amp;lt;br&amp;gt;&amp;lt;li&amp;gt;
/// For a list of built-in system users on Linux that should not be
/// used in this field, see [Selecting User Names for Linux on
/// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
/// </summary>
[JsonProperty(PropertyName = "adminUsername")]
public string AdminUsername { get; set; }

Converted HTML entities to HTML tags

I've hand-converted the HTML entities to HTML tags for easier comparison:

/// <summary>
/// Gets or sets specifies the name of the administrator account.
/// <br><br> **Windows-only restriction:**
/// Cannot end in "." <br><br> **Disallowed
/// values:** "administrator", "admin", "user", "user1", "test",
/// "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser",
/// "adm", "admin2", "aspnet", "backup", "console", "david", "guest",
/// "john", "owner", "root", "server", "sql", "support",
/// "support_388945a0", "sys", "test2", "test3", "user4", "user5".
/// <br><br> **Minimum-length (Linux):** 1
/// character <br><br> **Max-length
/// (Linux):** 64 characters <br><br>
/// **Max-length (Windows):** 20 characters
/// <br><br><li> For root
/// access to the Linux VM, see [Using root privileges on Linux virtual
/// machines in
/// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li>
/// For a list of built-in system users on Linux that should not be
/// used in this field, see [Selecting User Names for Linux on
/// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
/// </summary>
[JsonProperty(PropertyName = "adminUsername")]
public string AdminUsername { get; set; }

Converted HTML tags to C# XML comment equivalents

The proposed XML output for AutoRest when encountering such HTML tags in a Swagger description field.

/// <summary>
/// Gets or sets specifies the name of the administrator account.
/// <para>**Windows-only restriction:**
/// Cannot end in "." </para><para>**Disallowed
/// values:** "administrator", "admin", "user", "user1", "test",
/// "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser",
/// "adm", "admin2", "aspnet", "backup", "console", "david", "guest",
/// "john", "owner", "root", "server", "sql", "support",
/// "support_388945a0", "sys", "test2", "test3", "user4", "user5".</para>
/// <para>**Minimum-length (Linux):** 1
/// character</para><para>**Max-length
/// (Linux):** 64 characters <para>
/// **Max-length (Windows):** 20 characters</para>
/// <para><list type="bullet"><item> For root
/// access to the Linux VM, see [Using root privileges on Linux virtual
/// machines in
/// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)</item></para><para><list type="bullet"><item>
/// For a list of built-in system users on Linux that should not be
/// used in this field, see [Selecting User Names for Linux on
/// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)</para></item>
/// </summary>
[JsonProperty(PropertyName = "adminUsername")]
public string AdminUsername { get; set; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment