Repository: dotnet/aspnetcore
File: src/OpenApi/src/Schemas/OpenApiJsonSchema.Helpers.cs (C#)

Code before:

            if (reader.TryGetSingle(out var floatValue) && !float.IsInfinity(floatValue))
            {
                type = JsonSchemaType.Number;
                return floatValue;
            }

            if (reader.TryGetDouble(out var doubleValue))
            {
                type = JsonSchemaType.Number;
                return doubleValue;
            }
        }

        if (reader.TokenType == JsonTokenType.String)
        {
            type = JsonSchemaType.String;
            return reader.GetString();
        }

        if (reader.TokenType == JsonTokenType.StartArray)
        {
            type = JsonSchemaType.Array;
            var array = new JsonArray();
            reader.Read();
            while (reader.TokenType != JsonTokenType.EndArray)
            {
                array.Add(ReadJsonNode(ref reader));
                reader.Read();
            }
            return array;
        }

        if (reader.TokenType == JsonTokenType.StartObject)
        {
            type = JsonSchemaType.Object;
            var obj = new JsonObject();
            reader.Read();
            while (reader.TokenType != JsonTokenType.EndObject)
            {
                if (reader.TokenType != JsonTokenType.PropertyName)
                {
                    throw new JsonException("Expected PropertyName");
                }

                var key = reader.GetString()!;
                reader.Read();
                obj[key] = ReadJsonNode(ref reader);
                reader.Read();
            }
            return obj;

Review comment (suggestion):
```suggestion
			// Read to process JsonTokenType.StartArray before advancing
            reader.Read();
```

Code after:

            if (reader.TryGetSingle(out var floatValue) && !float.IsInfinity(floatValue))
            {
                type = JsonSchemaType.Number;
                return floatValue;
            }

            if (reader.TryGetDouble(out var doubleValue))
            {
                type = JsonSchemaType.Number;
                return doubleValue;
            }
        }

        if (reader.TokenType == JsonTokenType.String)
        {
            type = JsonSchemaType.String;
            return reader.GetString();
        }

        if (reader.TokenType == JsonTokenType.StartArray)
        {
            type = JsonSchemaType.Array;
            var array = new JsonArray();
            // Read to process JsonTokenType.StartArray before advancing
            reader.Read();
            while (reader.TokenType != JsonTokenType.EndArray)
            {
                array.Add(ReadJsonNode(ref reader));
                reader.Read();
            }
            return array;
        }

        if (reader.TokenType == JsonTokenType.StartObject)
        {
            type = JsonSchemaType.Object;
            var obj = new JsonObject();
            reader.Read();
            while (reader.TokenType != JsonTokenType.EndObject)
            {
                if (reader.TokenType != JsonTokenType.PropertyName)
                {
                    throw new JsonException("Expected PropertyName");
                }

                var key = reader.GetString()!;
                reader.Read();
                obj[key] = ReadJsonNode(ref reader);
                reader.Read();
            }