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] Can't use parameter keys #1114

Open
will-emmerson opened this issue Mar 27, 2024 · 0 comments
Open

[BUG] Can't use parameter keys #1114

will-emmerson opened this issue Mar 27, 2024 · 0 comments

Comments

@will-emmerson
Copy link

Describe the bug
I tried to add a parameter called keys like so:

@api.get("/getDeviceHistory", )
def get_device_history(request, deviceId, keys: str = "netDelta", rounding: bool = False):

But I get the following error:

Traceback (most recent call last):
  File "/home/will/saveeye/django_poc/venv/lib/python3.12/site-packages/ninja/operation.py", line 106, in run
    values = self._get_values(request, kw, temporal_response)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/will/saveeye/django_poc/venv/lib/python3.12/site-packages/ninja/operation.py", line 229, in _get_values
    values.update(data)
TypeError: 'str' object is not callable

I can see that it's probably conflicting with function keys in SupportsKeysAndGetItem but not sure what to do about it if anything.

Versions (please complete the following information):

  • Python version: 3.12
  • Django version: 5.0.1
  • Django-Ninja version: 1.1.0
  • Pydantic version: 2.5.3
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