-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f53f13
commit 453db29
Showing
14 changed files
with
150 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,23 @@ namespace LEGO.AsyncAPI.Models | |
{ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using LEGO.AsyncAPI.Attributes; | ||
using LEGO.AsyncAPI.Models.Interfaces; | ||
using LEGO.AsyncAPI.Writers; | ||
|
||
public enum AvroFieldOrder | ||
{ | ||
None = 0, | ||
|
||
[Display("ascending")] | ||
Ascending, | ||
|
||
[Display("descending")] | ||
Descending, | ||
|
||
[Display("ignore")] | ||
Ignore, | ||
} | ||
/// <summary> | ||
Check warning on line 24 in src/LEGO.AsyncAPI/Models/Avro/AvroField.cs GitHub Actions / build (windows-latest)
Check warning on line 24 in src/LEGO.AsyncAPI/Models/Avro/AvroField.cs GitHub Actions / build (macos-latest)
|
||
/// Represents a field within an Avro record schema. | ||
/// </summary> | ||
|
@@ -35,7 +49,7 @@ public class AvroField : IAsyncApiSerializable | |
/// <summary> | ||
/// The order of the field, can be 'ascending', 'descending', or 'ignore'. | ||
/// </summary> | ||
public string Order { get; set; } | ||
public AvroFieldOrder Order { get; set; } | ||
|
||
/// <summary> | ||
/// Alternate names for this record (optional). | ||
|
@@ -54,7 +68,11 @@ public void SerializeV2(IAsyncApiWriter writer) | |
writer.WriteOptionalObject("type", this.Type, (w, s) => s.SerializeV2(w)); | ||
writer.WriteOptionalProperty("doc", this.Doc); | ||
writer.WriteOptionalObject("default", this.Default, (w, s) => w.WriteAny(s)); | ||
writer.WriteOptionalProperty("order", this.Order); | ||
if (this.Order != AvroFieldOrder.None) | ||
{ | ||
writer.WriteOptionalProperty("order", this.Order.GetDisplayName()); | ||
} | ||
|
||
writer.WriteOptionalCollection("aliases", this.Aliases, (w, s) => w.WriteValue(s)); | ||
if (this.Metadata.Any()) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters