Open SyntaxColoring opened 3 years ago
It would be a good idea to get input from the participant(s) of #8236.
Current de-facto "standard" according to the app: https://github.com/Opentrons/opentrons/blob/6697e394458dfebf7974f7ff0edfd99f8a2e944b/app/src/redux/protocol/selectors.ts#L92-L138
Thought:
What happens if something like this happens?
authors
, typed as a str
.list[str] | str
.Now, when you upload a new JSON protocol (with a list of authors) to an old robot whose Pydantic models haven't been updated yet, the robot will throw a parse error. Even though it really has no reason to care about that metadata's schema; it should just pass it on to the client transparently. There's unnecessary coupling and fragility.
Options:
I think that's a good thought. I'd be pretty amenable to option 1: do not change the type of a field once "blessed". Add a new field if new information (or shape of information) is needed. Your example makes me think of npm's package.json spec, where there is both an "author" (singular) field and a "contributors" (plural) field
JSON protocols and Python protocols both have a notion of protocol metadata, which, roughly, is nonessential information like the protocol author. However, they don't have a unified notion of exactly what can be in this metadata.
The new HTTP API will pass protocol metadata straight through to the client. So, it will be more client-friendly if the protocol metadata follows a consistent, unified spec.
Questions to consider
author
) are known?author
an email address, or a name? Candescription
have Markdown?)null
equivalent to it being omitted?camelCase
orkebab-case
or something else?{"myCompanyMyCustomField": "foo"}
{"userExtra": {"myCustomField": "foo"} }
Definition of "done"