You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, l was looking at loading from a string as specified above. It turns out that the yaml module does not have a loads variant of their parsing API (in a fashion akin to json which has a load for stream objects and loads for string objects). Considering most libraries will support stream objects (like file pointers) by default, I almost wonder if providing an API that takes in a stream is more flexible than limiting to a string. With the structure mentioned in your post, I would have to initialize a StringIO object from the string. If I can just assume a stream object from the start, it makes the API more flexible because it means I don't need to add APIs for all types of classes. At that point, it becomes the responsibility of the caller to conform streams.
@ben-bay, does that sound reasonable? It would mean that instead of me taking the string, you would just initialize the stream on your end and pass it to Maestro.
It would be useful if
YAMLSpecification
had a class method that accepted yaml in string form (instead of a path to a yaml file), as follows:If that method existed,
load_specification
could just call it:The text was updated successfully, but these errors were encountered: