google-api-ruby-client icon indicating copy to clipboard operation
google-api-ruby-client copied to clipboard

Question: Types of cache_fill_bytes, response_size and request_size in HttpRequest

Open qingling128 opened this issue 9 years ago • 2 comments

In commit e3b8c800d649da00748d4605d847b342480ecc73, the types of three fields (cache_fill_bytes, response_size and request_size) in HttpRequest were changed from Integer to String. Is this by design or an accident? Just wanna double check that this is intended before we changed the implementation from our side.

Thanks!

$ git show e3b8c800d649da00748d4605d847b342480ecc73 generated/google/apis/logging_v2/representations.rb | grep "class HttpRequest" -A 25
       class HttpRequest
         # @private
         class Representation < Google::Apis::Core::JsonRepresentation
-          property :cache_validated_with_origin_server, as: 'cacheValidatedWithOriginServer'
-          property :status, as: 'status'
-          property :referer, as: 'referer'
           property :user_agent, as: 'userAgent'
           property :latency, as: 'latency'
-          property :cache_fill_bytes, as: 'cacheFillBytes'
+          property :cache_fill_bytes, :numeric_string => true, as: 'cacheFillBytes'
           property :request_method, as: 'requestMethod'
-          property :response_size, as: 'responseSize'
-          property :request_size, as: 'requestSize'
+          property :response_size, :numeric_string => true, as: 'responseSize'
+          property :request_size, :numeric_string => true, as: 'requestSize'
           property :request_url, as: 'requestUrl'
-          property :remote_ip, as: 'remoteIp'
           property :server_ip, as: 'serverIp'
+          property :remote_ip, as: 'remoteIp'
           property :cache_lookup, as: 'cacheLookup'
           property :cache_hit, as: 'cacheHit'
+          property :cache_validated_with_origin_server, as: 'cacheValidatedWithOriginServer'
+          property :status, as: 'status'
+          property :referer, as: 'referer'
+        end
+      end

qingling128 avatar Oct 09 '17 17:10 qingling128

Similarly, line in SourceLocation was also changed from Integer to String, which feels a bit weird.

$ git show e3b8c800d649da00748d4605d847b342480ecc73 generated/google/apis/logging_v2/representations.rb | grep "class SourceLocation" -A 10
       class SourceLocation
         # @private
         class Representation < Google::Apis::Core::JsonRepresentation
-          property :file, as: 'file'
           property :function_name, as: 'functionName'
-          property :line, as: 'line'
+          property :line, :numeric_string => true, as: 'line'
+          property :file, as: 'file'
         end
       end

qingling128 avatar Oct 09 '17 18:10 qingling128

Sorry for the slow response. We’re looking at old questions like this one. Is this still a concern for you?

TheRoyalTnetennba avatar Jun 06 '18 00:06 TheRoyalTnetennba