Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Commit 97c14a6

Browse files
committed
bagpipes-based projects, tests consolidation
1 parent aabc61c commit 97c14a6

18 files changed

Lines changed: 238 additions & 557 deletions

File tree

lib/commands/project/project.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var TEST_DEPENDENCIES = {
4646
chai: '^3.0.0',
4747
mocha: '^2.2.5',
4848
dotenv: '^1.2.0'
49-
}
49+
};
5050

5151
module.exports = {
5252
create: create,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swagger",
3-
"version": "0.6.3",
3+
"version": "0.7.0",
44
"description": "The Swagger command-line. Provides Swagger utilities and project lifecycle support.",
55
"keywords": [
66
"swagger",

project-skeletons/connect/api/swagger/swagger.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ paths:
4242
description: Error
4343
schema:
4444
$ref: "#/definitions/ErrorResponse"
45+
/swagger:
46+
x-swagger-pipe: swagger_raw
4547
# complex objects have schema definitions
4648
definitions:
4749
HelloWorldResponse:
Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,38 @@
11
# swagger configuration file
22

3-
# values in the swagger hash are system configuration for swagger
3+
# values in the swagger hash are system configuration for swagger-node
44
swagger:
5-
mapErrorsToJson: true
6-
docEndpoints:
7-
raw: /swagger
5+
6+
fittingsDirs: [ api/fittings, node_modules ]
7+
defaultPipe: null
8+
9+
swaggerControllerPipe: swagger_controllers # defines the standard processing pipe for controllers
10+
swaggerLoaderPipe: load_swagger
11+
12+
# values in the swagger:bagpipes hash are the bagpipes definitions
13+
bagpipes:
14+
15+
_router:
16+
name: swagger_router
17+
mockMode: false
18+
mockControllersDirs: [ api/mocks ]
19+
controllersDirs: [ api/controllers ]
20+
21+
_swagger_validate:
22+
name: swagger_validator
23+
validateReponse: true
24+
25+
# pipe for all swagger-node controllers
26+
swagger_controllers:
27+
- onError: json_error_handler
28+
- cors
29+
- swagger_security
30+
- _swagger_validate
31+
- express_compatibility
32+
- _router
33+
34+
# pipe to serve swagger (endpoint is in swagger.yaml)
35+
swagger_raw:
36+
name: swagger_raw
837

938
# any other values in this file are just loaded into the config for application access...

project-skeletons/connect/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"main": "app.js",
1010
"dependencies": {
1111
"connect": "^3.3.5",
12-
"swagger-connect": "0.0.x"
12+
"swagger-connect": "^0.1.0"
1313
},
1414
"devDependencies": {
1515
"should": "^5.2.0",

project-skeletons/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"main": "app.js",
1010
"dependencies": {
1111
"express": "^4.12.3",
12-
"swagger-express-mw": "0.0.x"
12+
"swagger-express-mw": "^0.1.0"
1313
},
1414
"devDependencies": {
1515
"should": "^5.2.0",

project-skeletons/hapi/app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ SwaggerHapi.create(config, function(err, swaggerHapi) {
1515

1616
var port = process.env.PORT || 10010;
1717
app.connection({ port: port });
18+
app.address = function() {
19+
return { port: port };
20+
};
1821

1922
app.register(swaggerHapi.plugin, function(err) {
2023
if (err) { return console.error('Failed to load plugin:', err); }

project-skeletons/hapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"main": "app.js",
1010
"dependencies": {
1111
"hapi": "^8.4.0",
12-
"swagger-hapi": "0.0.x"
12+
"swagger-hapi": "^0.1.0"
1313
},
1414
"devDependencies": {
1515
"should": "^5.2.0",

project-skeletons/restify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"main": "app.js",
1010
"dependencies": {
1111
"restify": "^3.0.1",
12-
"swagger-restify-mw": "0.0.x"
12+
"swagger-restify-mw": "^0.1.0"
1313
},
1414
"devDependencies": {
1515
"should": "^5.2.0",

project-skeletons/sails/api/swagger/swagger.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ paths:
4242
description: Error
4343
schema:
4444
$ref: "#/definitions/ErrorResponse"
45+
/swagger:
46+
x-swagger-pipe: swagger_raw
4547
# complex objects have schema definitions
4648
definitions:
4749
HelloWorldResponse:

0 commit comments

Comments
 (0)