nextcloud / nextcloud/tables

Remove manual json_decode in API endpoints

Open
#1,206 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage feature: api technical debt
Dominant language
JavaScript
Stars
214
Forks
52
Avg merge
1d 10h
Merged PRs (30d)
82

Description

In case the user wants to use endpoints where they have to send complex data they need to send it as the JSON body.
Allowing to send string data and then manually decoding it is unnecessary and leads to suboptimal OpenAPI specifications.
Removing that also allows typing the parameter as array which increases safety over manually checking it since the method would never be called if the input data didn't match.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the API endpoints that manually call json_decode and inspect their request parameter declarations and OpenAPI output. Remove the string-decoding path and verify that complex JSON bodies are typed as arrays and represented correctly in the generated specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.