Skip to content

[API] standardize API response #124

@mirkoCrobu

Description

@mirkoCrobu

Describe the request

We want to standardize the API response output so that the API always returns a predictable structure, regardless of whether data is present or not.
e.g, for a void array, we want "array": [].
All the current implementations that produce "array": null or where the field is omitted should be checked

We should also check if an API guidelines document already exists for Arduino. If not, we should consider creating one.

Describe the current behavior

Our API responses lack consistency regarding how empty fields—specifically arrays and lists—are handled. In several endpoints, if a field has no value, the key is either completely omitted from the JSON payload or returned as null.

Arduino App CLI version

All versions

Additional context

No response

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest version
  • My request contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions