jina.jaml.parsers.base module
class jina.jaml.parsers.base.VersionedYAMLParser[source]
Bases: object
Flow YAML parser for specific version
Every VersionedYAMLParser must implement two methods and one class attribute:
version = ‘legacy’
the version number this parser designed for
parse(cls, data)[source]
Return the Flow YAML parser given the syntax version number
Parameters
cls (
type
) – target class type to parse into, must be aJAMLCompatible
typedata (
Dict
) – flow yaml file loaded as python dict
Return type
Union
[ForwardRef
,ForwardRef
]
dump(data)[source]
Return the dictionary given a versioned flow object
Parameters
data (
Union
[ForwardRef
,ForwardRef
]) – versioned flow objectReturn type
Dict