palantir / palantir/conjure-java

Bean map fields should not allow null values

Open
#291 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
39
Forks
49
Avg merge
8h 22m
Merged PRs (30d)
32

Description

What happened?

MapExample.builder().items("foo", null).build() produces MapExample{items: {foo=null}}

What did you want to happen?

I expected a SafeNullPointerException("value cannot be null") to be thrown

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

Reproduce the issue with the MapExample.builder() call shown in the report, then locate the generated map-field builder and existing null-validation behavior. Confirm the expected SafeNullPointerException message and add coverage for a null map value; done means the example no longer builds with null values and the test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.