kumarrm / speedtracer

Automatically exported from code.google.com/p/speedtracer
0 stars 0 forks source link

Adding "duration" field fails validation, but optional in schema #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Validating using DumpValidator.validate(record) a record of type 12 
(RESOURCE_SEND_REQUEST in SpeedtracerSchemas.java). Including the field 
"duration" fails validation, even though it is listed as an "optional" field in 
the schema. 

record without "duration" validates:
{"data":{"identifier":6,"url":"http://www.google.com/","requestMethod":"GET"},"t
ype":12,"usedHeapSize":1792352,"totalHeapSize":3928256,"time":4243.961181640625}

added duration, won't validate:
{"data":{"identifier":6,"url":"http://www.google.com/","requestMethod":"GET"},"d
uration":120,"type":12,"usedHeapSize":1792352,"totalHeapSize":3928256,"time":424
3.961181640625}

Error message: "The property "duration" is not defined in the schema and the 
schema does not allow additional properties"

The schema definition for this type in SpeedtracerSchemas.java

"NETWORK_RESOURCE_START" : {
       "description" : "A network request is enqueued",
       "id" : "NETWORK_RESOURCE_START",
       "type" : "object",
       "extends" : {"$ref" : "TIMELINE_EVENT_MARK"},
       "properties" : {
         "type" : {"type" : "integer", "minimum" : 12, "maximum" : 12},
         "duration" : {"type" : "integer", "optional" : true},
         "data" : {
           "type" : "object",
           "properties" : {
             "identifier" : {"type" : "integer", "description" : "Integer id of this resource" },
             "url" : {"type" : "string", "description" : "URL Requested"},
             "requestMethod" : {
               "type" : "string",
               "description" : "Method used to retrieve the resource. (e.g. GET/POST)"
             }
           },
           "additionalProperties" : false
         },
         "additionalProperties" : false
       }
     }

Original issue reported on code.google.com by sarahgsm...@google.com on 13 Jul 2011 at 3:04

GoogleCodeExporter commented 9 years ago
Also, it seems the "duration" field for NETWORK_RESOURCE_START does not really 
belong there. It does not seem to be used or to make sense. But, there still 
seems to be a bug if it won't validate.

Original comment by sarahgsm...@google.com on 13 Jul 2011 at 3:10

GoogleCodeExporter commented 9 years ago
Should not have duration. Not investigating now, although it is still rather 
suspicious.

Original comment by sarahgsm...@google.com on 4 Aug 2011 at 1:17