notes icon indicating copy to clipboard operation
notes copied to clipboard

[Bug]: Boolean parameter in query parameters of API calls need to be set as integer

Open provokateurin opened this issue 3 years ago • 0 comments

⚠️ This issue respects the following points: ⚠️

  • [X] This is a bug, not a question or a configuration/webserver/proxy issue.
  • [X] This issue is not already reported on Github (I've searched it).
  • [X] Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • [X] Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • [X] I agree to follow Nextcloud's Code of Conduct.

Bug description

When a boolean paramater is passed in the query parameters of an API call it has to be set as an integer (0 or 1) instead of boolean (true or false). I checked the method header and it is set as a boolean. My questions is if this behaviour is intended because it doesn't seem logical to me. Note this is not specific to the Notes app, I only picked it as an example

Steps to reproduce

  1. Make API call to /apps/notes/api/v1/notes?category=c&title=a&content=b&modified=0&favorite=true -> note doesn't get favorited
  2. Make API call to /apps/notes/api/v1/notes?category=c&title=a&content=b&modified=0&favorite=1 -> note doesn't get favorited

Expected behavior

Using literal boolean values for boolean parameters should work.

Installation method

Community Docker image

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Nginx

Database engine version

SQlite

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • [X] Default user-backend (database)
  • [ ] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [ ] Other

Configuration report

Not relevant

List of activated Apps

Not relevant

Nextcloud Signing status

Not relevant

Nextcloud Logs

Not relevant

Additional info

No response

provokateurin avatar Sep 23 '22 14:09 provokateurin