Naganarasimha G R, Li Lu,
Regarding below comment,
but if some one uses rest directly then some entities will get posted and some will not, hence wanted to know whether its right to break in the middle ?
None of the entities will get posted to backend store.
BadRequestException is thrown during entity preprocessing phase. Not during store put. We first collect all the applicable entities which can be posted and then only call TimelineStore#put. We are not calling put from within the loop. Refer to TimelineDataManager#doPostEntities.
It can although be argued that we can post entities which can be and send a put error(new error type) for the entity which has no entity id or entity type. But if we do not have entity id or type, how will client recognize which specific entity has failed from put error ? Maybe they can cache entities which they have sent and then re-look at entities they attempted to post and find out which ones had entity id and entity type missing. But will client be doing so ? Current clients would be looking at entity id and type to find out which entities failed and why.
Entity ID and type are key pieces of information in ATSv1. If client is not sending them, it indicates some problem in the client side code. I think current code can be kept as it is because this will be consistent with TimelineClient side code too where none of the entities will be posted if entity id or type is missing in even one of them.