function clean(swaggerObject) {
  for (const prop of [
    'definitions',
    'responses',
    'parameters',
    'securityDefinitions',
  ]) {
    if (hasEmptyProperty(swaggerObject[prop])) {
      delete swaggerObject[prop];
    }
  }

  return swaggerObject;
}
OpenAPI specification validator does not accept empty values for a few properties.
Solves validator error: "Schema error should NOT have additional properties"
@param {object} swaggerObject
@returns {object} swaggerObject