Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
{
writer.WriteNull("requiredNullableList"u8);
}
writer.WritePropertyName("propertyWithSpecialDocs"u8);
writer.WriteStringValue(PropertyWithSpecialDocs);
if (options.Format != "W" && _additionalBinaryDataProperties != null)
{
foreach (var item in _additionalBinaryDataProperties)
Expand Down Expand Up @@ -182,6 +184,7 @@ internal static Thing DeserializeThing(JsonElement element, ModelReaderWriterOpt
string requiredBadDescription = default;
IList<int> optionalNullableList = default;
IList<int> requiredNullableList = default;
string propertyWithSpecialDocs = default;
IDictionary<string, BinaryData> additionalBinaryDataProperties = new ChangeTrackingDictionary<string, BinaryData>();
foreach (var prop in element.EnumerateObject())
{
Expand Down Expand Up @@ -311,6 +314,11 @@ internal static Thing DeserializeThing(JsonElement element, ModelReaderWriterOpt
requiredNullableList = array;
continue;
}
if (prop.NameEquals("propertyWithSpecialDocs"u8))
{
propertyWithSpecialDocs = prop.Value.GetString();
continue;
}
if (options.Format != "W")
{
additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText()));
Expand All @@ -333,6 +341,7 @@ internal static Thing DeserializeThing(JsonElement element, ModelReaderWriterOpt
requiredBadDescription,
optionalNullableList ?? new ChangeTrackingList<int>(),
requiredNullableList,
propertyWithSpecialDocs,
additionalBinaryDataProperties);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,30 @@ public partial class Thing
/// <param name="requiredNullableString"> required nullable string. </param>
/// <param name="requiredBadDescription"> description with xml &lt;|endoftext|&gt;. </param>
/// <param name="requiredNullableList"> required nullable collection. </param>
/// <exception cref="ArgumentNullException"> <paramref name="name"/>, <paramref name="requiredUnion"/> or <paramref name="requiredBadDescription"/> is null. </exception>
public Thing(string name, BinaryData requiredUnion, string requiredNullableString, string requiredBadDescription, IEnumerable<int> requiredNullableList)
/// <param name="propertyWithSpecialDocs">
/// This tests:
/// - Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.
/// - Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.
/// - Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.
/// - Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.
/// - **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.
/// - *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.
/// </param>
/// <exception cref="ArgumentNullException"> <paramref name="name"/>, <paramref name="requiredUnion"/>, <paramref name="requiredBadDescription"/> or <paramref name="propertyWithSpecialDocs"/> is null. </exception>
public Thing(string name, BinaryData requiredUnion, string requiredNullableString, string requiredBadDescription, IEnumerable<int> requiredNullableList, string propertyWithSpecialDocs)
{
Argument.AssertNotNull(name, nameof(name));
Argument.AssertNotNull(requiredUnion, nameof(requiredUnion));
Argument.AssertNotNull(requiredBadDescription, nameof(requiredBadDescription));
Argument.AssertNotNull(propertyWithSpecialDocs, nameof(propertyWithSpecialDocs));

Name = name;
RequiredUnion = requiredUnion;
RequiredNullableString = requiredNullableString;
RequiredBadDescription = requiredBadDescription;
OptionalNullableList = new ChangeTrackingList<int>();
RequiredNullableList = requiredNullableList?.ToList();
PropertyWithSpecialDocs = propertyWithSpecialDocs;
}

/// <summary> Initializes a new instance of <see cref="Thing"/>. </summary>
Expand All @@ -53,8 +64,17 @@ public Thing(string name, BinaryData requiredUnion, string requiredNullableStrin
/// <param name="requiredBadDescription"> description with xml &lt;|endoftext|&gt;. </param>
/// <param name="optionalNullableList"> optional nullable collection. </param>
/// <param name="requiredNullableList"> required nullable collection. </param>
/// <param name="propertyWithSpecialDocs">
/// This tests:
/// - Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.
/// - Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.
/// - Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.
/// - Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.
/// - **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.
/// - *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.
/// </param>
/// <param name="additionalBinaryDataProperties"> Keeps track of any properties unknown to the library. </param>
internal Thing(string name, BinaryData requiredUnion, string requiredLiteralString, string requiredNullableString, string optionalNullableString, int requiredLiteralInt, float requiredLiteralFloat, bool requiredLiteralBool, string optionalLiteralString, string requiredNullableLiteralString, int? optionalLiteralInt, float? optionalLiteralFloat, bool? optionalLiteralBool, string requiredBadDescription, IList<int> optionalNullableList, IList<int> requiredNullableList, IDictionary<string, BinaryData> additionalBinaryDataProperties)
internal Thing(string name, BinaryData requiredUnion, string requiredLiteralString, string requiredNullableString, string optionalNullableString, int requiredLiteralInt, float requiredLiteralFloat, bool requiredLiteralBool, string optionalLiteralString, string requiredNullableLiteralString, int? optionalLiteralInt, float? optionalLiteralFloat, bool? optionalLiteralBool, string requiredBadDescription, IList<int> optionalNullableList, IList<int> requiredNullableList, string propertyWithSpecialDocs, IDictionary<string, BinaryData> additionalBinaryDataProperties)
{
Name = name;
RequiredUnion = requiredUnion;
Expand All @@ -72,6 +92,7 @@ internal Thing(string name, BinaryData requiredUnion, string requiredLiteralStri
RequiredBadDescription = requiredBadDescription;
OptionalNullableList = optionalNullableList;
RequiredNullableList = requiredNullableList;
PropertyWithSpecialDocs = propertyWithSpecialDocs;
_additionalBinaryDataProperties = additionalBinaryDataProperties;
}

Expand Down Expand Up @@ -163,5 +184,16 @@ internal Thing(string name, BinaryData requiredUnion, string requiredLiteralStri

/// <summary> required nullable collection. </summary>
public IList<int> RequiredNullableList { get; set; }

/// <summary>
/// This tests:
/// - Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.
/// - Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.
/// - Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.
/// - Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.
/// - **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.
/// - *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.
/// </summary>
public string PropertyWithSpecialDocs { get; set; }
}
}
Loading
Loading