Events - empty array elements as [] not null #13996

Closed
opened 2025-11-02 10:59:36 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @hwaastad on GitHub (Jan 15, 2025).

Description

Hi,
Currently, if a pull_request has no assignees, the event will have the following:

{
  "event": {
    "pull_request": {
      "assignees": null
    }
  }

I think it would be a better (and more intuitive) way to define arrays as empty [] rather than null (null-safe). This is also more aligned to github events.

Other arrays are:
topics
labels
requested_reviewers
requested_reviewers_teams

Gitea Version

1.23.1

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

k8s, docker

Database

PostgreSQL

Originally created by @hwaastad on GitHub (Jan 15, 2025). ### Description Hi, Currently, if a pull_request has no assignees, the event will have the following: ``` { "event": { "pull_request": { "assignees": null } } ``` I think it would be a better (and more intuitive) way to define arrays as empty [] rather than null (null-safe). This is also more aligned to github events. Other arrays are: topics labels requested_reviewers requested_reviewers_teams ### Gitea Version 1.23.1 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? k8s, docker ### Database PostgreSQL
GiteaMirror added the topic/webhookstype/bug labels 2025-11-02 10:59:36 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Feb 12, 2025):

I added SliceNilAsEmpty in #33569 and covered your findings.

@wxiaoguang commented on GitHub (Feb 12, 2025): I added `SliceNilAsEmpty` in #33569 and covered your findings.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13996