MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / is_byte_param

Function is_byte_param

scripts/generate-sdk.py:51–58  ·  view source on GitHub ↗

True when a string param should accept an encoding-tagged payload. Driven by an explicit "binary": true flag on the schema property (emitted by SchemaBuilder's byteProp), NOT by the parameter name -- name-based guessing wrongly wrapped text params like console.send's `data` in base64.

(name, prop)

Source from the content-addressed store, hash-verified

49
50
51def is_byte_param(name, prop):
52 """True when a string param should accept an encoding-tagged payload.
53
54 Driven by an explicit "binary": true flag on the schema property (emitted by
55 SchemaBuilder's byteProp), NOT by the parameter name -- name-based guessing
56 wrongly wrapped text params like console.send's `data` in base64.
57 """
58 return bool(prop.get("binary")) and prop.get("type", "string") == "string"
59
60
61def ordered_params(cmd):

Callers 2

emit_jsFunction · 0.85
emit_luaFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected