MCPcopy Create free account
hub / github.com/StackStorm/st2 / _cast_none

Function _cast_none

st2common/st2common/util/casts.py:81–88  ·  view source on GitHub ↗

Cast function which serializes special magic string value which indicate "None" to None type.

(x)

Source from the content-addressed store, hash-verified

79
80
81def _cast_none(x):
82 """
83 Cast function which serializes special magic string value which indicate "None" to None type.
84 """
85 if isinstance(x, six.string_types) and x == data.NONE_MAGIC_VALUE:
86 return None
87
88 return x
89
90
91# These types as they appear in json schema.

Callers 5

_cast_objectFunction · 0.85
_cast_booleanFunction · 0.85
_cast_integerFunction · 0.85
_cast_numberFunction · 0.85
_cast_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected