Updated type constructors to indicate that they should not be called directly

This commit is contained in:
Jeremy Whitlock 2015-05-26 15:51:40 -06:00
Родитель 6b573fe79c
Коммит e9145eaa7b
5 изменённых файлов: 34 добавлений и 10 удалений

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -25,6 +25,8 @@
### new Operation(path, method, ptr, definition, parameters) ### new Operation(path, method, ptr, definition, parameters)
The Swagger Operation object. The Swagger Operation object.
<strong>Note:</strong> Do not use directly.
| Param | Type | Description | | Param | Type | Description |
| --- | --- | --- | | --- | --- | --- |
@ -47,6 +49,8 @@ Returns all parameters for the operation.
### new Parameter(ptr, definition) ### new Parameter(ptr, definition)
The Swagger Parameter object. The Swagger Parameter object.
<strong>Note:</strong> Do not use directly.
| Param | Type | Description | | Param | Type | Description |
| --- | --- | --- | | --- | --- | --- |
@ -66,6 +70,8 @@ The Swagger Parameter object.
### new SwaggerApi(definition, version, documentation, operations, options) ### new SwaggerApi(definition, version, documentation, operations, options)
The Swagger API object. The Swagger API object.
<strong>Note:</strong> Do not use directly.
| Param | Type | Description | | Param | Type | Description |
| --- | --- | --- | | --- | --- | --- |
@ -116,7 +122,7 @@ Creates a SwaggerApi object from its Swagger definition(s).
**Example** **Example**
```js ```js
// Example using promises // Example using promises
SwaggerApi.create('http://petstore.swagger.io/v2/swagger.yaml') SwaggerApi.create({definition: 'http://petstore.swagger.io/v2/swagger.yaml'})
.then(function (api) { .then(function (api) {
console.log('Documentation URL: ', api.documentation); console.log('Documentation URL: ', api.documentation);
}, function (err) { }, function (err) {
@ -126,7 +132,7 @@ SwaggerApi.create('http://petstore.swagger.io/v2/swagger.yaml')
**Example** **Example**
```js ```js
// Example using callbacks // Example using callbacks
SwaggerApi.create('http://petstore.swagger.io/v2/swagger.yaml', function (err, api) { SwaggerApi.create({definition: 'http://petstore.swagger.io/v2/swagger.yaml'}, function (err, api) {
if (err) { if (err) {
console.error(err.stack); console.error(err.stack);
} else { } else {

Просмотреть файл

@ -50,7 +50,7 @@ var supportedVersions = {
* *
* @example * @example
* // Example using promises * // Example using promises
* SwaggerApi.create('http://petstore.swagger.io/v2/swagger.yaml') * SwaggerApi.create({definition: 'http://petstore.swagger.io/v2/swagger.yaml'})
* .then(function (api) { * .then(function (api) {
* console.log('Documentation URL: ', api.documentation); * console.log('Documentation URL: ', api.documentation);
* }, function (err) { * }, function (err) {
@ -59,7 +59,7 @@ var supportedVersions = {
* *
* @example * @example
* // Example using callbacks * // Example using callbacks
* SwaggerApi.create('http://petstore.swagger.io/v2/swagger.yaml', function (err, api) { * SwaggerApi.create({definition: 'http://petstore.swagger.io/v2/swagger.yaml'}, function (err, api) {
* if (err) { * if (err) {
* console.error(err.stack); * console.error(err.stack);
* } else { * } else {

Просмотреть файл

@ -29,6 +29,8 @@ var _ = require('lodash-compat');
/** /**
* The Swagger Operation object. * The Swagger Operation object.
* *
* <strong>Note:</strong> Do not use directly.
*
* @param {string} path - The operation path * @param {string} path - The operation path
* @param {string} method - The operation method * @param {string} method - The operation method
* @param {string} ptr - The JSON Pointer to the operation * @param {string} ptr - The JSON Pointer to the operation
@ -60,6 +62,8 @@ Operation.prototype.getParameters = function () {
/** /**
* The Swagger Parameter object. * The Swagger Parameter object.
* *
* <strong>Note:</strong> Do not use directly.
*
* @param {string} ptr - The JSON Pointer to the parameter * @param {string} ptr - The JSON Pointer to the parameter
* @param {object} definition - The parameter definition * @param {object} definition - The parameter definition
* *
@ -76,6 +80,8 @@ function Parameter (ptr, definition) {
/** /**
* The Swagger API object. * The Swagger API object.
* *
* <strong>Note:</strong> Do not use directly.
*
* @param {object} definition - The Swagger definition * @param {object} definition - The Swagger definition
* @param {string} version - The Swagger definition version * @param {string} version - The Swagger definition version
* @param {string} documentation - The Swagger Specification documentation URL * @param {string} documentation - The Swagger Specification documentation URL