Skip to content

Commit 7f5f2be

Browse files
committed
Handle "all" explicitly
1 parent e435de9 commit 7f5f2be

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Elastic.Documentation/AppliesTo/ApplicableToJsonConverter.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,14 @@ public class ApplicableToJsonConverter : JsonConverter<ApplicableTo>
7272
break;
7373
case "version":
7474
var versionStr = reader.GetString();
75-
if (versionStr != null && VersionSpec.TryParse(versionStr, out var v))
76-
version = v;
75+
if (versionStr != null)
76+
{
77+
// Handle "all" explicitly for AllVersionsSpec
78+
if (string.Equals(versionStr.Trim(), "all", StringComparison.OrdinalIgnoreCase))
79+
version = AllVersionsSpec.Instance;
80+
else if (VersionSpec.TryParse(versionStr, out var v))
81+
version = v;
82+
}
7783
break;
7884
}
7985
}

0 commit comments

Comments
 (0)