lib/types/api-definition.js
function ApiDefinition (definition, definitionRemotesResolved, definitionFullyResolved, references, options) {
  var that = this;

  debug('Creating ApiDefinition from %s',
        _.isString(options.definition) ? options.definition : 'the provided OpenAPI definition');

  // Assign this so other object can use it
  this._debug = debug;

  // Assign local properties
  this.customFormats = {};
  this.customFormatGenerators = {};
  this.customValidators = [];
  this.definition = definition;
  this.definitionFullyResolved = definitionFullyResolved;
  this.definitionRemotesResolved = definitionRemotesResolved;
  this.documentationUrl = 'https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md';
  this.options = options;
  this.references = references;
  this.version = '2.0';

  // Assign local properties from the OpenAPI Object definition
  _.assign(this, definition);

  // Register custom formats
  _.each(options.customFormats, _.bind(ApiDefinition.prototype.registerFormat, this));

  // Register custom formats
  _.each(options.customFormatGenerators, _.bind(ApiDefinition.prototype.registerFormatGenerator, this));

  // Register custom validators
  _.each(options.customValidators, _.bind(ApiDefinition.prototype.registerValidator, this));

  debug('  Paths:');

  // Create the Path objects
  this.pathObjects = _.map(definitionFullyResolved.paths, function (pathDef, path) {
    return new Path(that,
                    path,
                    _.get(definitionRemotesResolved, ['paths', path]),
                    pathDef,
                    ['paths', path]);
  });
}
function ApiDefinition (definition, definitionRemotesResolved, definitionFullyResolved, references, options) {
  var that = this;

  debug('Creating ApiDefinition from %s',
        _.isString(options.definition) ? options.definition : 'the provided OpenAPI definition');

  // Assign this so other object can use it
  this._debug = debug;

  // Assign local properties
  this.customFormats = {};
  this.customFormatGenerators = {};
  this.customValidators = [];
  this.definition = definition;
  this.definitionFullyResolved = definitionFullyResolved;
  this.definitionRemotesResolved = definitionRemotesResolved;
  this.documentationUrl = 'https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md';
  this.options = options;
  this.references = references;
  this.version = '2.0';

  // Assign local properties from the OpenAPI Object definition
  _.assign(this, definition);

  // Register custom formats
  _.each(options.customFormats, _.bind(ApiDefinition.prototype.registerFormat, this));

  // Register custom formats
  _.each(options.customFormatGenerators, _.bind(ApiDefinition.prototype.registerFormatGenerator, this));

  // Register custom validators
  _.each(options.customValidators, _.bind(ApiDefinition.prototype.registerValidator, this));

  debug('  Paths:');

  // Create the Path objects
  this.pathObjects = _.map(definitionFullyResolved.paths, function (pathDef, path) {
    return new Path(that,
                    path,
                    _.get(definitionRemotesResolved, ['paths', path]),
                    pathDef,
                    ['paths', path]);
  });
}
function ApiDefinition ( definition , definitionRemotesResolved , definitionFullyResolved , references , options ) { var that = this ; debug ( 'Creating ApiDefinition from %s' , _ . isString ( options . definition ) ? options . definition : 'the provided OpenAPI definition' ) ; // Assign this so other object can use it this . _debug = debug ; // Assign local properties this . customFormats = { } ; this . customFormatGenerators = { } ; this . customValidators = [ ] ; this . definition = definition ; this . definitionFullyResolved = definitionFullyResolved ; this . definitionRemotesResolved = definitionRemotesResolved ; this . documentationUrl = 'https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md' ; this . options = options ; this . references = references ; this . version = '2.0' ; // Assign local properties from the OpenAPI Object definition _ . assign ( this , definition ) ; // Register custom formats _ . each ( options . customFormats , _ . bind ( ApiDefinition . prototype . registerFormat , this ) ) ; // Register custom formats _ . each ( options . customFormatGenerators , _ . bind ( ApiDefinition . prototype . registerFormatGenerator , this ) ) ; // Register custom validators _ . each ( options . customValidators , _ . bind ( ApiDefinition . prototype . registerValidator , this ) ) ; debug ( '  Paths:' ) ; // Create the Path objects this . pathObjects = _ . map ( definitionFullyResolved . paths , function ( pathDef , path ) { return new Path ( that , path , _ . get ( definitionRemotesResolved , [ 'paths' , path ] ) , pathDef , [ 'paths' , path ] ) ; } ) ; }
The OpenAPI Definition object.

**Note:** Do not use directly.

**Extra Properties:** Other than the documented properties, this object also exposes all properties of the
[OpenAPI Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#openapi-object).

@param {object} definition - The original OpenAPI definition
@param {object} definitionRemotesResolved - The OpenAPI definition with all of its remote references resolved
@param {object} definitionFullyResolved - The OpenAPI definition with all of its references resolved
@param {object} references - The location and resolution of the resolved references in the OpenAPI definition
@param {object} options - The options passed to ApiDefinition.create

@property {object} customFormats - The key/value pair of custom formats *(The keys are the format name and the values
are async functions.  See [ZSchema Custom Formats](https://github.com/zaggino/z-schema#register-a-custom-format))*
@property {object} customFormatGenerators - The key/value pair of custom format generators *(The keys are the format name and the values
are functions.  See [json-schema-mocker Custom Format](https://github.com/json-schema-faker/json-schema-faker#custom-formats))*
@property {module:sway.DocumentValidationFunction[]} customValidators - The array of custom validators
@property {object} definition - The original OpenAPI definition
@property {object} definitionRemotesResolved - The OpenAPI definition with only its remote references resolved *(This
means all references to external/remote documents are replaced with its dereferenced value but all local references
are left unresolved.)*
@property {object} definitionFullyResolved - The OpenAPI definition with all of its resolvable references resolved
*(This means that all resolvable references are replaced with their dereferenced value.)*
@property {string} documentationUrl - The URL to the OpenAPI documentation
@property {module:sway.Path[]} pathObjects - The unique `Path` objects
@property {object} options - The options passed to the constructor
@property {object} references - The reference metadata *(See [JsonRefs~ResolvedRefDetails](https://github.com/whitlockjc/json-refs/blob/master/docs/API.md#module_JsonRefs..ResolvedRefDetails))*
@property {string} version - The OpenAPI version

@constructor

@memberof module:sway
The OpenAPI Definition object .