Skip to content

Commit

Permalink
Use multiline comments for examples in csharp generator (#19079)
Browse files Browse the repository at this point in the history
* multi

* gen
  • Loading branch information
ReallyLiri authored Sep 22, 2024
1 parent eebecc8 commit b4edca5
Show file tree
Hide file tree
Showing 123 changed files with 413 additions and 217 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace {{packageName}}.Models
/// <value>{{.}}</value>
{{/description}}
{{#example}}
/// <example>{{.}}</example>
/* <example>{{.}}</example> */
{{/example}}
{{#required}}
[Required]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace {{modelPackage}}
/// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
/// </summary>{{#description}}
/// <value>{{.}}</value>{{/description}}{{#example}}
/// <example>{{.}}</example>{{/example}}{{#required}}
/* <example>{{.}}</example> */{{/example}}{{#required}}
[Required]{{/required}}{{#pattern}}
[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}
[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace {{modelPackage}}
/// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
/// </summary>{{#description}}
/// <value>{{.}}</value>{{/description}}{{#example}}
/// <example>{{.}}</example>{{/example}}{{#required}}
/* <example>{{.}}</example> */{{/example}}{{#required}}
[Required]{{/required}}{{#pattern}}
[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}
[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/// <value>{{description}}</value>
{{/description}}
{{#example}}
/// <example>{{.}}</example>
/* <example>{{.}}</example> */
{{/example}}
{{^conditionalSerialization}}
[DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})]
Expand Down Expand Up @@ -183,7 +183,7 @@
/// </summary>{{#description}}
/// <value>{{description}}</value>{{/description}}
{{#example}}
/// <example>{{.}}</example>
/* <example>{{.}}</example> */
{{/example}}
{{^conditionalSerialization}}
[DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
/// <value>{{.}}</value>
{{/description}}
{{#example}}
/// <example>{{.}}</example>
/* <example>{{.}}</example> */
{{/example}}
[JsonPropertyName("{{baseName}}")]
{{#deprecated}}
Expand All @@ -136,7 +136,7 @@
/// </summary>{{#description}}
/// <value>{{.}}</value>{{/description}}
{{#example}}
/// <example>{{.}}</example>
/* <example>{{.}}</example> */
{{/example}}
{{#deprecated}}
[Obsolete]
Expand All @@ -152,7 +152,7 @@
/// </summary>{{#description}}
/// <value>{{.}}</value>{{/description}}
{{#example}}
/// <example>{{.}}</example>
/* <example>{{.}}</example> */
{{/example}}
{{#deprecated}}
[Obsolete]
Expand Down Expand Up @@ -193,7 +193,7 @@
/// </summary>{{#description}}
/// <value>{{.}}</value>{{/description}}
{{#example}}
/// <example>{{.}}</example>
/* <example>{{.}}</example> */
{{/example}}
[JsonPropertyName("{{baseName}}")]
{{#deprecated}}
Expand All @@ -218,7 +218,7 @@
/// </summary>{{#description}}
/// <value>{{.}}</value>{{/description}}
{{#example}}
/// <example>{{.}}</example>
/* <example>{{.}}</example> */
{{/example}}
[JsonPropertyName("{{baseName}}")]
{{#deprecated}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
/// <value>{{.}}</value>
{{/description}}
{{#example}}
/// <example>{{.}}</example>
/*
<example>{{.}}</example>
*/
{{/example}}
{{^conditionalSerialization}}
[DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})]
Expand Down Expand Up @@ -214,7 +216,9 @@
/// </summary>{{#description}}
/// <value>{{.}}</value>{{/description}}
{{#example}}
/// <example>{{.}}</example>
/*
<example>{{.}}</example>
*/
{{/example}}
{{^conditionalSerialization}}
[DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ public partial class Category : IEquatable<Category>, IValidatableObject
/// <summary>
/// Gets or Sets Id
/// </summary>
/// <example>1</example>
/*
<example>1</example>
*/
[DataMember(Name = "id", EmitDefaultValue = false)]
public long Id { get; set; }

/// <summary>
/// Gets or Sets Name
/// </summary>
/// <example>Dogs</example>
/*
<example>Dogs</example>
*/
[DataMember(Name = "name", EmitDefaultValue = false)]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public partial class DataQuery : Query, IEquatable<DataQuery>, IValidatableObjec
/// Some text containing white spaces
/// </summary>
/// <value>Some text containing white spaces</value>
/// <example>Some text</example>
/*
<example>Some text</example>
*/
[DataMember(Name = "text", EmitDefaultValue = false)]
public string Text { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,18 @@ protected Pet() { }
/// <summary>
/// Gets or Sets Id
/// </summary>
/// <example>10</example>
/*
<example>10</example>
*/
[DataMember(Name = "id", EmitDefaultValue = false)]
public long Id { get; set; }

/// <summary>
/// Gets or Sets Name
/// </summary>
/// <example>doggie</example>
/*
<example>doggie</example>
*/
[DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,18 @@ public partial class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectPa
/// <summary>
/// Gets or Sets Id
/// </summary>
/// <example>1</example>
/*
<example>1</example>
*/
[DataMember(Name = "id", EmitDefaultValue = false)]
public long Id { get; set; }

/// <summary>
/// Gets or Sets Name
/// </summary>
/// <example>Dogs</example>
/*
<example>Dogs</example>
*/
[DataMember(Name = "name", EmitDefaultValue = false)]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public DateOnlyClass(Option<DateTime?> dateOnlyProperty = default)
/// <summary>
/// Gets or Sets DateOnlyProperty
/// </summary>
/// <example>Fri Jul 21 00:00:00 UTC 2017</example>
/* <example>Fri Jul 21 00:00:00 UTC 2017</example> */
[JsonPropertyName("dateOnlyProperty")]
public DateTime? DateOnlyProperty { get { return this.DateOnlyPropertyOption; } set { this.DateOnlyPropertyOption = new Option<DateTime?>(value); } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password,
/// <summary>
/// Gets or Sets Date
/// </summary>
/// <example>Sun Feb 02 00:00:00 UTC 2020</example>
/* <example>Sun Feb 02 00:00:00 UTC 2020</example> */
[JsonPropertyName("date")]
public DateTime Date { get; set; }

Expand Down Expand Up @@ -136,7 +136,7 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password,
/// <summary>
/// Gets or Sets DateTime
/// </summary>
/// <example>2007-12-03T10:15:30+01:00</example>
/* <example>2007-12-03T10:15:30+01:00</example> */
[JsonPropertyName("dateTime")]
public DateTime? DateTime { get { return this.DateTimeOption; } set { this.DateTimeOption = new Option<DateTime?>(value); } }

Expand Down Expand Up @@ -374,7 +374,7 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password,
/// <summary>
/// Gets or Sets Uuid
/// </summary>
/// <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example>
/* <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example> */
[JsonPropertyName("uuid")]
public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = new Option<Guid?>(value); } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public NullableGuidClass(Option<Guid?> uuid = default)
/// <summary>
/// Gets or Sets Uuid
/// </summary>
/// <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example>
/* <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example> */
[JsonPropertyName("uuid")]
public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = new Option<Guid?>(value); } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public Order(Option<bool?> complete = default, Option<long?> id = default, Optio
/// <summary>
/// Gets or Sets ShipDate
/// </summary>
/// <example>2020-02-02T20:20:20.000222Z</example>
/* <example>2020-02-02T20:20:20.000222Z</example> */
[JsonPropertyName("shipDate")]
public DateTime? ShipDate { get { return this.ShipDateOption; } set { this.ShipDateOption = new Option<DateTime?>(value); } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Pet(string name, List<string> photoUrls, Option<Category> category = defa
/// <summary>
/// Gets or Sets Name
/// </summary>
/// <example>doggie</example>
/* <example>doggie</example> */
[JsonPropertyName("name")]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public RequiredClass(DateTime requiredNotNullableDateProp, List<string> required
/// <summary>
/// Gets or Sets RequiredNotnullableUuid
/// </summary>
/// <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example>
/* <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example> */
[JsonPropertyName("required_notnullable_uuid")]
public Guid RequiredNotnullableUuid { get; set; }

Expand Down Expand Up @@ -437,7 +437,7 @@ public RequiredClass(DateTime requiredNotNullableDateProp, List<string> required
/// <summary>
/// Gets or Sets NotrequiredNotnullableUuid
/// </summary>
/// <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example>
/* <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example> */
[JsonPropertyName("notrequired_notnullable_uuid")]
public Guid? NotrequiredNotnullableUuid { get { return this.NotrequiredNotnullableUuidOption; } set { this.NotrequiredNotnullableUuidOption = new Option<Guid?>(value); } }

Expand Down Expand Up @@ -503,7 +503,7 @@ public RequiredClass(DateTime requiredNotNullableDateProp, List<string> required
/// <summary>
/// Gets or Sets NotrequiredNullableUuid
/// </summary>
/// <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example>
/* <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example> */
[JsonPropertyName("notrequired_nullable_uuid")]
public Guid? NotrequiredNullableUuid { get { return this.NotrequiredNullableUuidOption; } set { this.NotrequiredNullableUuidOption = new Option<Guid?>(value); } }

Expand Down Expand Up @@ -546,7 +546,7 @@ public RequiredClass(DateTime requiredNotNullableDateProp, List<string> required
/// <summary>
/// Gets or Sets RequiredNullableUuid
/// </summary>
/// <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example>
/* <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example> */
[JsonPropertyName("required_nullable_uuid")]
public Guid? RequiredNullableUuid { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public DateOnlyClass(Option<DateTime?> dateOnlyProperty = default)
/// <summary>
/// Gets or Sets DateOnlyProperty
/// </summary>
/// <example>Fri Jul 21 00:00:00 UTC 2017</example>
/* <example>Fri Jul 21 00:00:00 UTC 2017</example> */
[JsonPropertyName("dateOnlyProperty")]
public DateTime? DateOnlyProperty { get { return this.DateOnlyPropertyOption; } set { this.DateOnlyPropertyOption = new Option<DateTime?>(value); } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password,
/// <summary>
/// Gets or Sets Date
/// </summary>
/// <example>Sun Feb 02 00:00:00 UTC 2020</example>
/* <example>Sun Feb 02 00:00:00 UTC 2020</example> */
[JsonPropertyName("date")]
public DateTime Date { get; set; }

Expand Down Expand Up @@ -136,7 +136,7 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password,
/// <summary>
/// Gets or Sets DateTime
/// </summary>
/// <example>2007-12-03T10:15:30+01:00</example>
/* <example>2007-12-03T10:15:30+01:00</example> */
[JsonPropertyName("dateTime")]
public DateTime? DateTime { get { return this.DateTimeOption; } set { this.DateTimeOption = new Option<DateTime?>(value); } }

Expand Down Expand Up @@ -374,7 +374,7 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password,
/// <summary>
/// Gets or Sets Uuid
/// </summary>
/// <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example>
/* <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example> */
[JsonPropertyName("uuid")]
public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = new Option<Guid?>(value); } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public NullableGuidClass(Option<Guid?> uuid = default)
/// <summary>
/// Gets or Sets Uuid
/// </summary>
/// <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example>
/* <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example> */
[JsonPropertyName("uuid")]
public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = new Option<Guid?>(value); } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public static string StatusEnumToJsonValue(StatusEnum? value)
/// <summary>
/// Gets or Sets ShipDate
/// </summary>
/// <example>2020-02-02T20:20:20.000222Z</example>
/* <example>2020-02-02T20:20:20.000222Z</example> */
[JsonPropertyName("shipDate")]
public DateTime? ShipDate { get { return this.ShipDateOption; } set { this.ShipDateOption = new Option<DateTime?>(value); } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public static string StatusEnumToJsonValue(StatusEnum? value)
/// <summary>
/// Gets or Sets Name
/// </summary>
/// <example>doggie</example>
/* <example>doggie</example> */
[JsonPropertyName("name")]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ public static string RequiredNullableEnumStringEnumToJsonValue(RequiredNullableE
/// <summary>
/// Gets or Sets RequiredNotnullableUuid
/// </summary>
/// <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example>
/* <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example> */
[JsonPropertyName("required_notnullable_uuid")]
public Guid RequiredNotnullableUuid { get; set; }

Expand Down Expand Up @@ -1515,7 +1515,7 @@ public static string RequiredNullableEnumStringEnumToJsonValue(RequiredNullableE
/// <summary>
/// Gets or Sets NotrequiredNotnullableUuid
/// </summary>
/// <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example>
/* <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example> */
[JsonPropertyName("notrequired_notnullable_uuid")]
public Guid? NotrequiredNotnullableUuid { get { return this.NotrequiredNotnullableUuidOption; } set { this.NotrequiredNotnullableUuidOption = new Option<Guid?>(value); } }

Expand Down Expand Up @@ -1581,7 +1581,7 @@ public static string RequiredNullableEnumStringEnumToJsonValue(RequiredNullableE
/// <summary>
/// Gets or Sets NotrequiredNullableUuid
/// </summary>
/// <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example>
/* <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example> */
[JsonPropertyName("notrequired_nullable_uuid")]
public Guid? NotrequiredNullableUuid { get { return this.NotrequiredNullableUuidOption; } set { this.NotrequiredNullableUuidOption = new Option<Guid?>(value); } }

Expand Down Expand Up @@ -1624,7 +1624,7 @@ public static string RequiredNullableEnumStringEnumToJsonValue(RequiredNullableE
/// <summary>
/// Gets or Sets RequiredNullableUuid
/// </summary>
/// <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example>
/* <example>72f98069-206d-4f12-9f12-3d1e525a8e84</example> */
[JsonPropertyName("required_nullable_uuid")]
public Guid? RequiredNullableUuid { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public DateOnlyClass(Option<DateTime?> dateOnlyProperty = default)
/// <summary>
/// Gets or Sets DateOnlyProperty
/// </summary>
/// <example>Fri Jul 21 00:00:00 UTC 2017</example>
/* <example>Fri Jul 21 00:00:00 UTC 2017</example> */
[JsonPropertyName("dateOnlyProperty")]
public DateTime? DateOnlyProperty { get { return this.DateOnlyPropertyOption; } set { this.DateOnlyPropertyOption = new Option<DateTime?>(value); } }

Expand Down
Loading

0 comments on commit b4edca5

Please sign in to comment.