Skip to content

RequestBody changes with metadata only changes (i.e. description) causes nullpointer exception #64

Closed
@jinta

Description

@jinta

When specifiying a Markdown file output and only changing the description under a requestBody the application fails with a NullPointerException in this bit of code

if (operation.resultRequestBody().isDifferent()) {
  details
           .append(titleH5("Request:"))
           .append(bodyContent(operation.getRequestBody().getContent()));
}

It recognises the operation to have changed but the content of the getRequestBody is null in this scenario.

A potential fix is to have a null check in the bodyContent method i.e.:

protected String bodyContent(String prefix, ChangedContent changedContent){
  if (changedContent == null) {
    return ""; // or prefix?
  }
  ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions