Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for tags field on Server model #565

Merged
merged 2 commits into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/models/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const ServerSecurityRequirement = require('./server-security-requirement');
const MixinDescription = require('../mixins/description');
const MixinBindings = require('../mixins/bindings');
const MixinSpecificationExtensions = require('../mixins/specification-extensions');
const MixinTags = require('../mixins/tags');

/**
* Implements functions to deal with a Server object.
Expand All @@ -16,6 +17,7 @@ const MixinSpecificationExtensions = require('../mixins/specification-extensions
* @mixes MixinDescription
* @mixes MixinBindings
* @mixes MixinSpecificationExtensions
* @mixes MixinTags
* @returns {Server}
*/
class Server extends Base {
Expand Down Expand Up @@ -71,4 +73,4 @@ class Server extends Base {
}
}

module.exports = mix(Server, MixinDescription, MixinBindings, MixinSpecificationExtensions);
module.exports = mix(Server, MixinDescription, MixinBindings, MixinSpecificationExtensions, MixinTags);
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
},
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.6",
"@asyncapi/specs": "^3.0.0",
"@asyncapi/specs": "2.15.0-next-spec.2",
"@fmvilas/pseudo-yaml-ast": "^0.3.1",
"ajv": "^6.10.1",
"js-yaml": "^3.13.1",
Expand Down
4 changes: 3 additions & 1 deletion test/models/server_test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const { expect } = require('chai');
const js = { url: 'test.com', protocol: 'amqp', protocolVersion: '0-9-1', description: 'test', variables: { test1: { enum: ['value1', 'value2'], default: 'value1', description: 'test1', examples: ['value2'] } }, security: [{ oauth2: ['user:read'] }], bindings: { amqp: 'test' }, 'x-test': 'testing' };
const js = { url: 'test.com', protocol: 'amqp', protocolVersion: '0-9-1', description: 'test', variables: { test1: { enum: ['value1', 'value2'], default: 'value1', description: 'test1', examples: ['value2'] } }, security: [{ oauth2: ['user:read'] }], bindings: { amqp: 'test' }, 'x-test': 'testing', tags: [{ name: 'env:development' }] };

const Server = require('../../lib/models/server');

const { assertMixinDescriptionInheritance } = require('../mixins/description_test');
const { assertMixinBindingsInheritance } = require('../mixins/bindings_test');
const { assertMixinSpecificationExtensionsInheritance } = require('../mixins/specification-extensions_test');
const { assertMixinTagsInheritance } = require('../mixins/tags_test');

describe('Server', function() {
describe('#url()', function() {
Expand Down Expand Up @@ -73,6 +74,7 @@ describe('Server', function() {
assertMixinDescriptionInheritance(Server);
assertMixinBindingsInheritance(Server);
assertMixinSpecificationExtensionsInheritance(Server);
assertMixinTagsInheritance(Server);
});
});
});