Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: object and array params not supported? #111

Open
2 tasks done
sdebionne opened this issue Oct 8, 2024 · 2 comments
Open
2 tasks done

Bug: object and array params not supported? #111

sdebionne opened this issue Oct 8, 2024 · 2 comments
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@sdebionne
Copy link

Describe the bug

When using a dict in the rpc params, the server returns {'jsonrpc': '2.0', 'id': 35342, 'error': {'code': -32602, 'message': 'Invalid method param(s).'}}.

Steps to reproduce

File server.py:

from ucall.posix import Server

server = Server(
    port=8545,
)

@server
def foo(person: dict):
    print(f"[RCV] prepare {person=}", flush=True)

server.run()

File client.py:

from ucall.client import Client

params = {
    "firstname": "John",
    "lastname": "Doe",
}

client = Client(port=8545)

res = client.foo(person=params)
print(f"[CLIENT] client.foo returned {res.data=}", flush=True)

Expected behavior

Should serialize/deserialize the dict from/to JSON.

UCall version

0.5.4

Operating System

Ubuntu 20.04

Hardware architecture

x86

Which interface are you using?

Official Python bindings

Which implementation are you using?

POSIX

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@sdebionne sdebionne added bug Something isn't working invalid This doesn't seem right labels Oct 8, 2024
@sdebionne sdebionne changed the title Bug: dict params not supported? Bug: object and array params not supported? Oct 8, 2024
@ashvardanian
Copy link
Collaborator

Yes, such arguments are not supported in v0, but will be in v1.

@sdebionne
Copy link
Author

I found this project that provides a python binding for simdjson: https://github.com/TkTech/pysimdjson
If it works as advertised, that means not much work (or even simplification) should be necessary to support the full JSON data model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants