Skip to content

Commit de6c822

Browse files
theletterfcodexcursoragent
committed
Preserve comparer on populated sets
Use collection expressions as constructor input so style analyzers pass while the API explorer sets keep case-insensitive comparisons. Co-Authored-By: GPT-5.5 <noreply@openai.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7035d02 commit de6c822

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/Elastic.ApiExplorer/Schema/SchemaHelpers.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,35 @@ public static class SchemaHelpers
1919
/// <summary>
2020
/// Types that are known to be value types (resolve to primitives like string).
2121
/// </summary>
22-
public static readonly HashSet<string> KnownValueTypes = new(StringComparer.OrdinalIgnoreCase)
23-
{
22+
public static readonly HashSet<string> KnownValueTypes = new(
23+
[
2424
"Field", "Fields", "Id", "Ids", "IndexName", "Indices", "Name", "Names",
2525
"Routing", "VersionNumber", "SequenceNumber", "PropertyName", "RelationName",
2626
"TaskId", "ScrollId", "SuggestionName", "Duration", "DateMath", "Fuzziness",
2727
"GeoHashPrecision", "Distance", "TimeOfDay", "MinimumShouldMatch", "Script",
2828
"ByteSize", "Percentage", "Stringifiedboolean", "ExpandWildcards", "float", "Stringifiedinteger",
2929
// Numeric value types
3030
"uint", "ulong", "long", "int", "short", "ushort", "byte", "sbyte", "double", "decimal"
31-
};
31+
], StringComparer.OrdinalIgnoreCase);
3232

3333
/// <summary>
3434
/// Types that have dedicated pages we can link to.
3535
/// Only container types get their own pages - individual queries/aggregations are rendered inline.
3636
/// </summary>
37-
public static readonly HashSet<string> LinkedTypes = new(StringComparer.OrdinalIgnoreCase)
38-
{
37+
public static readonly HashSet<string> LinkedTypes = new(
38+
[
3939
"QueryContainer", "AggregationContainer", "Aggregate"
40-
};
40+
], StringComparer.OrdinalIgnoreCase);
4141

4242
/// <summary>
4343
/// Primitive/generic type names that are not named schema types.
4444
/// These should not be considered for recursive type detection since they
4545
/// represent generic types rather than specific schema references.
4646
/// </summary>
47-
public static readonly HashSet<string> PrimitiveTypeNames = new(StringComparer.OrdinalIgnoreCase)
48-
{
47+
public static readonly HashSet<string> PrimitiveTypeNames = new(
48+
[
4949
"boolean", "number", "string", "integer", "object", "null", "array"
50-
};
50+
], StringComparer.OrdinalIgnoreCase);
5151

5252
/// <summary>
5353
/// Gets the URL for a container type's dedicated page.

0 commit comments

Comments
 (0)