The OpenAPI specification states that:
Each tag name in the list MUST be unique.
To reflect this attribute, it would be great if we could model the top-level tags collection in to the document as a hash set of sorts. However, because it is currently modeled as an IList it is difficult to encode this uniqueness constraint in the source:
|
public IList<OpenApiTag>? Tags { get; set; } = new List<OpenApiTag>(); |
We should consider taking a breaking change to change the type to ICollectionor IEnumerable so that consumer can initialize a HashSet to enforce the uniqueness constraint.
The OpenAPI specification states that:
To reflect this attribute, it would be great if we could model the top-level tags collection in to the document as a hash set of sorts. However, because it is currently modeled as an
IListit is difficult to encode this uniqueness constraint in the source:OpenAPI.NET/src/Microsoft.OpenApi/Models/OpenApiDocument.cs
Line 74 in 47bf1eb
We should consider taking a breaking change to change the type to
ICollectionorIEnumerableso that consumer can initialize aHashSetto enforce the uniqueness constraint.