Skip to content

v2: Make it easier to model OpenAPI tags as a hash set #1983

@captainsafia

Description

@captainsafia

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.

Metadata

Metadata

Assignees

Labels

priority:p1High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions