@@ -2,7 +2,7 @@ const fetch = require('node-fetch');
2
2
const fs = require ( 'fs' ) ;
3
3
const jsonToGo = require ( '../vendor/json-to-go.js' ) ;
4
4
const buildPath = require ( './buildPath' ) ;
5
- const { isJsonString, loadConfig, loadFile, loadJson, capitalize } = require ( "./common" ) ;
5
+ const { isJsonString, loadConfig, loadFile, loadJson, toPascalCase } = require ( "./common" ) ;
6
6
7
7
let cliOpts
8
8
@@ -35,7 +35,7 @@ function run(urlStr, body, options) {
35
35
return res . json ( )
36
36
} )
37
37
. then ( json => {
38
- let method = capitalize ( opts ?. method )
38
+ let method = toPascalCase ( opts ?. method )
39
39
const struct = jsonToGo ( JSON . stringify ( json ) , path . struct + method ) ;
40
40
const content = buildContent ( struct . go , path , comment , "" )
41
41
write ( json , path , content )
@@ -151,11 +151,11 @@ function buildContent(go, path, comment, paramType) {
151
151
content += `import "time"\n\n`
152
152
}
153
153
if ( paramType === "body" ) {
154
- content += `// ${ go . split ( " " ) [ 1 ] } is the structure of the the HTTP Request Body Parameter.\n//`
154
+ content += `// ${ go . split ( " " ) [ 1 ] } is the struct of the the HTTP Request Body Parameter.\n//`
155
155
} else if ( paramType === "query" ) {
156
- content += `// ${ go . split ( " " ) [ 1 ] } is the structure of the HTTP Request Query Parameter.\n//`
156
+ content += `// ${ go . split ( " " ) [ 1 ] } is the struct of the HTTP Request Query Parameter.\n//`
157
157
} else {
158
- content += `// ${ go . split ( " " ) [ 1 ] } is the structure of the HTTP Response Body.\n//`
158
+ content += `// ${ go . split ( " " ) [ 1 ] } is the struct of the HTTP Response Body.\n//`
159
159
}
160
160
content += comment
161
161
content += go
0 commit comments