Repository navigation
Description
Summary
Verify and resolve cases where SDK-backed opportunity APIs emit null for fields that the protocol allows to be omitted but does not allow to be null.
During Hono template verification, SDK 0.7.2 accepted an opportunity with funding.details: null and the API returned it with HTTP 200. Validation against the protocol 0.4.0 schema bundled with CLI 0.4.0 rejected that response. source: null reproduced the same disagreement. Reproduce these cases against current versions before making changes.
Optionality and nullability are separate: a field may be omitted without accepting explicit null. Accepting null inside an SDK is not itself a wire-compatibility defect if serialization omits it before transmission. This issue concerns serialized data that violates the protocol contract, not identical internal representations across languages.
The scope is the opportunity list, detail and search contracts and their shared models. This is not a rollout of nullable optional fields under ADR 0024.
Acceptance criteria
- Reproduce the reported
funding.detailsandsourcecases against current protocol and SDK versions, checking serialized responses rather than SDK validation alone. If the disagreements no longer occur, record the evidence and close the issue without implementation changes. - For confirmed disagreements, align SDK validation or serialization with the existing protocol contract. Preserve omission for optional fields and do not broaden protocol nullability as part of this fix.
- Add regression tests covering omitted fields, explicit null and valid values for the affected fields. Serialized output must satisfy the protocol schema; wrong non-null types and missing required fields must still fail.
- Verify the corresponding TypeScript and Python SDK behavior, including any shared-model effects. Internal handling may differ as long as serialized data conforms.
- Document compatibility implications, affected packages and any release or migration requirements.
Evidence and scope
- Historical reproduction: common-grants/cg-api-template-hono#1, using SDK 0.7.2 and protocol 0.4.0 bundled with CLI 0.4.0.
- ADR 0024 permits nullable optional fields; this ticket does not assume that every optional field must accept null. The existing field definitions govern this compatibility fix.
- Changes to required
CustomField.value([Core] Decide optional vs. nullable behavior forCustomField.value#1108), pagination constraints ([TS SDK] Consolidate the duplicate sort and pagination param schemas #1130), the general parity harness, and CLI comparison repairs ([CLI] Fix howresolveAnyOf()incg check specworks #735 and [CLI] Aligncheck specREADME and implementation #524) remain separate. - Merge Patch null-as-deletion behavior is unchanged. This issue does not redesign organization relationships or other resources.
- Coordinate any required fixes with the Core and SDK release work. This ticket does not independently require a protocol schema change or a universal nullability migration.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
test(ts-sdk): give the fields and types parity tests boundary cases
test(ts-sdk): probe the reverse direction on the filter and sorting s…
test(ts-sdk): give models, pagination, and responses boundary cases
fix(ts-sdk): catch permissive schema drift and empty parity-test runs (…
feat: add CommonGrants Hono API template (#1)
feat(core): add funders to the opportunity model [#1220-T1]
feat(core): add funders to the opportunity model [#1220-T1]
[-][Core] Align opportunity API nullability with ADR 0024[/-][+][Core] Resolve opportunity API nullability mismatches between SDKs and protocol[/+]docs(website): finalize the v0.5.0 migration notes and release copy (#…
feat(ts-sdk): add Zod schemas and types for the award models (#1290)
[#1244-T1] Replace funders/identifiers placeholders with the v0.5 sch…
feat(ts-sdk): align opportunity funders and identifiers with Core v0.5 (
feat(py-sdk)!: align opportunity identifiers and funders with Core v0…