Skip to content

CRUDOperations field missing in CallSite JSON when value is null for non-crud callsites #108

Closed
@rahlk

Description

@rahlk

Describe the bug

When serializing CallSite objects to JSON, the CRUDOperations field is missing if its value is null. This leads to inconsistencies in the JSON structure, causing downstream processes that rely on the presence of the CRUDOperations key to fail or behave unexpectedly.


Steps To Reproduce

  1. Create a CallSite object with the CRUDOperations field set to null.
  2. Serialize the CallSite object using Gson.
  3. Inspect the resulting JSON output.
  4. Observe that the CRUDOperations key is missing from the JSON.

Observed behavior

The CRUDOperations key does not appear in the JSON when its value is null, which disrupts systems expecting a consistent schema with this key present.


Expected behavior

The CRUDOperations key should appear in the JSON output, even when its value is null, to maintain a consistent schema for all CallSite objects.


Error Log

Not applicable, as the issue is related to the absence of expected fields in the JSON structure rather than an explicit error.


Environment (please complete the following information):

  • OS: Fedora 41
  • Version of Java: 21
  • Version of Gson: 2.10.1
  • Version of Maven/Gradle: N/A

Additional context

This issue can be resolved by configuring Gson to include null values during serialization using new GsonBuilder().serializeNulls().create().

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions