lib/mock/semantic-response.js
function SemanticResponse (response, path) {
  /**
   * The JSON schema of the response
   * @type {object|null}
   */
  this.schema = response.schema || null;

  /**
   * The response headers, from the Swagger API
   * @type {object|null}
   */
  this.headers = response.headers || null;

  /**
   * If true, then an empty response should be sent.
   * @type {boolean}
   */
  this.isEmpty = !response.schema;

  /**
   * Indicates whether the response should be a single resource, or a collection.
   * @type {boolean}
   */
  this.isCollection = false;

  /**
   * Indicates whether the response schema is a wrapper around the actual resource data.
   * It's common for RESTful APIs to include a response wrapper with additional metadata,
   * and one of the properties of the wrapper is the actual resource data.
   * @type {boolean}
   */
  this.isWrapped = false;

  /**
   * If the response is wrapped, then this is the name of the wrapper property that
   * contains the actual resource data.
   * @type {string}
   */
  this.wrapperProperty = "";

  /**
   * The date/time that the response data was last modified.
   * This is used to set the Last-Modified HTTP header (if defined in the Swagger API)
   *
   * Each mock implementation sets this to the appropriate value.
   *
   * @type {Date}
   */
  this.lastModified = null;

  /**
   * The location (URL) of the REST resource.
   * This is used to set the Location HTTP header (if defined in the Swagger API)
   *
   * Some mocks implementations set this value.  If left blank, then the Location header
   * will be set to the current path.
   *
   * @type {string}
   */
  this.location = "";

  if (!this.isEmpty) {
    this.setWrapperInfo(response, path);
  }
}
function SemanticResponse (response, path) {
  /**
   * The JSON schema of the response
   * @type {object|null}
   */
  this.schema = response.schema || null;

  /**
   * The response headers, from the Swagger API
   * @type {object|null}
   */
  this.headers = response.headers || null;

  /**
   * If true, then an empty response should be sent.
   * @type {boolean}
   */
  this.isEmpty = !response.schema;

  /**
   * Indicates whether the response should be a single resource, or a collection.
   * @type {boolean}
   */
  this.isCollection = false;

  /**
   * Indicates whether the response schema is a wrapper around the actual resource data.
   * It's common for RESTful APIs to include a response wrapper with additional metadata,
   * and one of the properties of the wrapper is the actual resource data.
   * @type {boolean}
   */
  this.isWrapped = false;

  /**
   * If the response is wrapped, then this is the name of the wrapper property that
   * contains the actual resource data.
   * @type {string}
   */
  this.wrapperProperty = "";

  /**
   * The date/time that the response data was last modified.
   * This is used to set the Last-Modified HTTP header (if defined in the Swagger API)
   *
   * Each mock implementation sets this to the appropriate value.
   *
   * @type {Date}
   */
  this.lastModified = null;

  /**
   * The location (URL) of the REST resource.
   * This is used to set the Location HTTP header (if defined in the Swagger API)
   *
   * Some mocks implementations set this value.  If left blank, then the Location header
   * will be set to the current path.
   *
   * @type {string}
   */
  this.location = "";

  if (!this.isEmpty) {
    this.setWrapperInfo(response, path);
  }
}
function SemanticResponse ( response , path ) { /**
   * The JSON schema of the response
   * @type {object|null}
   */ this . schema = response . schema || null ; /**
   * The response headers, from the Swagger API
   * @type {object|null}
   */ this . headers = response . headers || null ; /**
   * If true, then an empty response should be sent.
   * @type {boolean}
   */ this . isEmpty = ! response . schema ; /**
   * Indicates whether the response should be a single resource, or a collection.
   * @type {boolean}
   */ this . isCollection = false ; /**
   * Indicates whether the response schema is a wrapper around the actual resource data.
   * It's common for RESTful APIs to include a response wrapper with additional metadata,
   * and one of the properties of the wrapper is the actual resource data.
   * @type {boolean}
   */ this . isWrapped = false ; /**
   * If the response is wrapped, then this is the name of the wrapper property that
   * contains the actual resource data.
   * @type {string}
   */ this . wrapperProperty = "" ; /**
   * The date/time that the response data was last modified.
   * This is used to set the Last-Modified HTTP header (if defined in the Swagger API)
   *
   * Each mock implementation sets this to the appropriate value.
   *
   * @type {Date}
   */ this . lastModified = null ; /**
   * The location (URL) of the REST resource.
   * This is used to set the Location HTTP header (if defined in the Swagger API)
   *
   * Some mocks implementations set this value.  If left blank, then the Location header
   * will be set to the current path.
   *
   * @type {string}
   */ this . location = "" ; if ( ! this . isEmpty ) { this . setWrapperInfo ( response , path ) ; } }
Describes the semantics of a Swagger response.

@param   {object}    response - The Response object, from the Swagger API
@param   {object}    path     - The Path object that contains the response. Used for semantic analysis.
@constructor
Describes the semantics of a Swagger response .