Skip to content

Commit ca9acf0

Browse files
committed
config; bash
1 parent c15222f commit ca9acf0

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The templates with a status have a working (if not necessarily tested) configura
5555
|**apache2**|configuration|**needs work**||
5656
|apex||
5757
|aspnetcore||
58-
|bash||
58+
|bash|client|**needs testing**||@bkryza|@MikeRalphson
5959
|clojure||
6060
|codegen||
6161
|**confluenceWikiDocs**|documentation|**needs testing**||

adaptor.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ String.prototype.toCamelCase = function camelize() {
1616
});
1717
}
1818

19+
// TODO add html and possibly termcap renderers
20+
const markdownPPs = {
21+
nop: function(markdown) {
22+
return markdown;
23+
}
24+
};
25+
1926
const typeMaps = {
2027
nop: function(type,required,schema) {
2128
return type;
@@ -44,6 +51,7 @@ const typeMaps = {
4451
};
4552

4653
let typeMap = typeMaps.nop;
54+
let markdownPP = markdownPPs.nop;
4755

4856
function transform(api, defaults) {
4957
let obj = Object.assign({},defaults);
@@ -89,6 +97,20 @@ function transform(api, defaults) {
8997
obj.classFilename = obj.classname;
9098
obj.jsModuleName = obj.classname;
9199
obj.jsProjectName = obj.classname;
100+
if (defaults.swagger) {
101+
obj.swagger = defaults.swagger;
102+
}
103+
else {
104+
obj.swagger = {};
105+
obj.swagger.swagger = api.openapi;
106+
obj.swagger.info = api.info;
107+
obj.tags = api.tags;
108+
obj.externalDocs = api.externalDocs;
109+
obj.swagger.paths = api.paths;
110+
if (api.components && api.components.schemas) {
111+
obj.swagger.definitions = api.components.schemas;
112+
}
113+
}
92114

93115
if (api.components && api.components.securitySchemes) {
94116
obj.hasAuthMethods = true;

configs/bash.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"defaults": {
3+
},
4+
"transformations": [
5+
{ "input": "api_doc.mustache", "output": "api_doc.md" },
6+
{ "input": "bash-completion.mustache", "output": "bash-completion.sh" },
7+
{ "input": "client.mustache", "output": "client.sh" },
8+
{ "input": "Dockerfile.mustache", "output": "Dockerfile" },
9+
{ "input": "model_doc.mustache", "output": "model_doc.md" },
10+
{ "input": "README.mustache", "output": "README.md" },
11+
{ "input": "README.md", "output": "CODEGEN.md" },
12+
{ "input": "zsh-completion.mustache", "output": "zsh-completion.sh" }
13+
]
14+
}

0 commit comments

Comments
 (0)