bluesky / event-model

data model for event-based data collection and analysis
https://blueskyproject.io/event-model
BSD 3-Clause "New" or "Revised" License
15 stars 31 forks source link

run_start.additionalProperties should either be True, or a field for additionalProperties should be provided. #285

Closed DiamondJoseph closed 1 year ago

DiamondJoseph commented 1 year ago

Expected Behavior

run_start.additionalProperties is false, but the RunEngine makes use of additionalProperties to encode arbitrary metadata. Either additionalProperties should be true, to mark that this is intended and that where additionalProperties is false it can be assumed that there will be no additional properties; or the arbitrary metadata should be moved into a field on run_start.

Context

While writing a service that consumes documents, as additionalProperties is clearly false in practice ('detectors', 'motors' two very commonly used metadata keys from Bluesky plans that are on the run_start root document), it implies that additionalProperties cannot be trusted on other document types and handling must be provided in case there is metadata attached to these documents.

DiamondJoseph commented 1 year ago

This was my misunderstanding about how patternProperties works

Actually run_start, event_descriptor and run_stop all have that field and allow metadata that complies to the regex expression "^([^.]+)$"