swagger-api / swagger-api/swagger-core

enhancement : prevent ApiResponse#getHeaders from NullPointerException

Open
#4,414 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
Dominant language
Java
Stars
7.5k
Forks
2.3k
Avg merge
18h 1m
Merged PRs (30d)
10

Description

ApiResponse class headers field can be null.
Initialize the headers field with empty Map In order to prevent NullPointerException when calling the ApiResponse#getHeaders.

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

Search the Java source for the ApiResponse class and inspect the headers field and getHeaders() method. Ensure an ApiResponse with no headers can safely call getHeaders() without a NullPointerException, and verify the relevant project tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.