Skip to content
Permalink
Browse files
[hotfix] use make_json_type
This closes #9.
  • Loading branch information
igalshilman authored and tzulitai committed Mar 25, 2021
1 parent 30351de commit 183820e2134ac154e5ca04cdf71e591dc0264fb1
Showing 1 changed file with 1 addition and 13 deletions.
@@ -23,19 +23,7 @@

functions = StatefulFunctions()


def serialize_json_utf8(obj) -> bytes:
"""
serialize the given object as a JSON utf-8 bytes.
"""
str = json.dumps(obj, ensure_ascii=False)
return str.encode('utf-8')


GREET_REQUEST_TYPE = simple_type(typename="example/GreetRequest",
serialize_fn=serialize_json_utf8,
deserialize_fn=json.loads)

GREET_REQUEST_TYPE = make_json_type(typename="example/GreetRequest")

@functions.bind(typename="example/person", specs=[ValueSpec(name="visits", type=IntType)])
async def person(context: Context, message: Message):

0 comments on commit 183820e

Please sign in to comment.