Current implementation deviates from the standard. Look at @simontrasler's approach in OpenRTB and copy it.