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

Documentation for Pythonic drop-in API is wrong #38

Open
aspacca opened this issue Aug 2, 2022 · 0 comments
Open

Documentation for Pythonic drop-in API is wrong #38

aspacca opened this issue Aug 2, 2022 · 0 comments

Comments

@aspacca
Copy link

aspacca commented Aug 2, 2022

parser = cysimdjson.JSONParser()
json_parsed = parser.loads(json_bytes)

# Access using JSON Pointer
print(json_parsed.json_parsed['foo'])
  1. passing bytes to parser.loads returns a TypeError: the param is expected to be str https://github.com/TeskaLabs/cysimdjson/blob/main/cysimdjson/cysimdjson.pyx#L454
  2. even passing str json_parsed has no json_parsed element, like it is written in the print example

I ended up doing something like:

parser.parse(payload).get_value()

I still have to validate that's what I need :)
(at the moment I'm parsing only and not accessing the object)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant