Skip to content

Commit

Permalink
fix: schema.type() docs (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmvilas authored Apr 27, 2020
1 parent e2973e1 commit 9efc208
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ Implements functions to deal with a Schema object.
* [.minProperties()](#Schema+minProperties) ⇒ <code>number</code>
* [.required()](#Schema+required) ⇒ <code>Array.&lt;string&gt;</code>
* [.enum()](#Schema+enum) ⇒ <code>Array.&lt;any&gt;</code>
* [.type()](#Schema+type) ⇒ <code>string</code>
* [.type()](#Schema+type) ⇒ <code>string</code> \| <code>Array.&lt;string&gt;</code>
* [.allOf()](#Schema+allOf)[<code>Array.&lt;Schema&gt;</code>](#Schema)
* [.oneOf()](#Schema+oneOf)[<code>Array.&lt;Schema&gt;</code>](#Schema)
* [.anyOf()](#Schema+anyOf)[<code>Array.&lt;Schema&gt;</code>](#Schema)
Expand Down Expand Up @@ -1347,7 +1347,7 @@ Implements functions to deal with a Schema object.
**Kind**: instance method of [<code>Schema</code>](#Schema)
<a name="Schema+type"></a>

### schema.type() ⇒ <code>string</code>
### schema.type() ⇒ <code>string</code> \| <code>Array.&lt;string&gt;</code>
**Kind**: instance method of [<code>Schema</code>](#Schema)
<a name="Schema+allOf"></a>

Expand Down
2 changes: 1 addition & 1 deletion lib/models/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class Schema extends Base {
}

/**
* @returns {string}
* @returns {string|string[]}
*/
type() {
return this._json.type;
Expand Down
2 changes: 1 addition & 1 deletion test/models/schema_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ describe('Schema', () => {
expect(d.type()).to.be.equal(doc.type);
});

it('should return an array', () => {
it('should return an array of strings', () => {
const doc = { "type": ["number", "string"] };
const d = new Schema(doc);
expect(Array.isArray(d.type())).to.be.equal(true);
Expand Down

0 comments on commit 9efc208

Please sign in to comment.