Skip to content

Commit

Permalink
remove extra line
Browse files Browse the repository at this point in the history
  • Loading branch information
heysujal committed Dec 3, 2024
1 parent 2d3fa00 commit b6532fb
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion codegens/csharp-httpclient/lib/CodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class CodeBuilder {
extra = '';
}
this.currentIndentCount--;
this.snippet += this.indentation + '}' + extra + this.newLineChar;
this.snippet += this.indentation + '}' + extra;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion codegens/dart-http/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ self = module.exports = {
}
headerSnippet += 'import \'package:http/http.dart\' as http;\n\n';
headerSnippet += 'void main() async {\n';
footerSnippet = '}\n';
footerSnippet = '}';
}

// The following code handles multiple files in the same formdata param.
Expand Down
2 changes: 1 addition & 1 deletion codegens/java-unirest/lib/unirest.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function makeSnippet (request, indentString, options) {
});
}
snippet += parseRequest.parseBody(request, indentString, options.trimRequestBody);
snippet += indentString + '.asString();\n';
snippet += indentString + '.asString();';

return snippet;
}
Expand Down
2 changes: 1 addition & 1 deletion codegens/libcurl/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ self = module.exports = {
snippet += indentString + 'curl_slist_free_all(headers);\n';
}
snippet += '}\n';
snippet += 'curl_easy_cleanup(curl);\n';
snippet += 'curl_easy_cleanup(curl);';
(options.includeBoilerplate) &&
(snippet = indentString + snippet.split('\n').join('\n' + indentString));
callback(null, headerSnippet + snippet + footerSnippet);
Expand Down
4 changes: 2 additions & 2 deletions codegens/nodejs-axios/lib/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function makeSnippet (request, indentString, options) {
snippet += indentString.repeat(2) + 'console.log(error);\n';
snippet += indentString + '}\n';
snippet += '}\n\n';
snippet += 'makeRequest();\n';
snippet += 'makeRequest();';
}
else {
snippet += 'axios.request(config)\n';
Expand All @@ -145,7 +145,7 @@ function makeSnippet (request, indentString, options) {
snippet += '})\n';
snippet += '.catch((error) => {\n';
snippet += indentString + 'console.log(error);\n';
snippet += '});\n';
snippet += '});';
}

return snippet;
Expand Down
2 changes: 1 addition & 1 deletion codegens/nodejs-request/lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function makeSnippet (request, indentString, options) {
}
snippet += indentString + 'if (error) throw new Error(error);\n';
snippet += indentString + 'console.log(response.body);\n';
snippet += '});\n';
snippet += '});';
return snippet;
}

Expand Down
2 changes: 1 addition & 1 deletion codegens/nodejs-unirest/lib/unirest.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function makeSnippet (request, indentString, options) {
}
snippet += indentString.repeat(2) + 'if (res.error) throw new Error(res.error); \n';
snippet += indentString.repeat(2) + 'console.log(res.raw_body);\n';
snippet += indentString + '});\n';
snippet += indentString + '});';

return snippet;
}
Expand Down
2 changes: 1 addition & 1 deletion codegens/php-curl/lib/php-curl.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ self = module.exports = {
snippet += '));\n\n';
snippet += '$response = curl_exec($curl);\n\n';
snippet += 'curl_close($curl);\n';
snippet += 'echo $response;\n';
snippet += 'echo $response;';

return callback(null, snippet);
}
Expand Down
4 changes: 2 additions & 2 deletions codegens/php-guzzle/lib/phpGuzzle.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function getSnippetFooterSync (includeRequestOptions) {
'echo $res->getBody();\n';
}
return '$res = $client->send($request, $options);\n' +
'echo $res->getBody();\n';
'echo $res->getBody();';
}

/**
Expand All @@ -179,7 +179,7 @@ function getSnippetFooterAsync (includeRequestOptions) {
'echo $res->getBody();\n';
}
return '$res = $client->sendAsync($request, $options)->wait();\n' +
'echo $res->getBody();\n';
'echo $res->getBody();';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion codegens/php-pecl-http/lib/phpPecl.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ self = module.exports = {
snippet += `${getHeaders(request, indentation)}\n`;
snippet += '$client->enqueue($request)->send();\n';
snippet += '$response = $client->getResponse();\n';
snippet += 'echo $response->getBody();\n';
snippet += 'echo $response->getBody();';

return callback(null, snippet);
}
Expand Down
2 changes: 1 addition & 1 deletion codegens/python-requests/lib/python-requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ self = module.exports = {
snippet += !options.followRedirect ? ', allow_redirects=False' : '';
snippet += options.requestTimeout !== 0 ? `, timeout=${options.requestTimeout}` : '';
snippet += ')\n\n';
snippet += 'print(response.text)\n';
snippet += 'print(response.text)';

callback(null, snippet);
}
Expand Down
4 changes: 2 additions & 2 deletions codegens/ruby/lib/ruby.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ self = module.exports = {
}
snippet += `${parseBody(request.toJSON(), options.trimRequestBody, contentType, options.indentCount)}\n`;
snippet += 'response = https.request(request)\n';
snippet += 'puts response.read_body\n';
snippet += 'puts response.read_body';
}
else {
snippet += 'http = Net::HTTP.new(url.host, url.port);\n';
Expand Down Expand Up @@ -226,7 +226,7 @@ self = module.exports = {
}
snippet += `${parseBody(request.toJSON(), options.trimRequestBody, contentType, options.indentCount)}\n`;
snippet += 'response = http.request(request)\n';
snippet += 'puts response.read_body\n';
snippet += 'puts response.read_body';
}

return callback(null, snippet);
Expand Down
2 changes: 1 addition & 1 deletion codegens/swift/lib/swift.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ self = module.exports = {
codeSnippet += `${indent}print(String(data: data, encoding: .utf8)!)\n`;
codeSnippet += options.includeBoilerplate ? `${indent}exit(EXIT_SUCCESS)\n` : '';
codeSnippet += '}\n\n';
codeSnippet += 'task.resume()\n';
codeSnippet += 'task.resume()' + options.includeBoilerplate ? '\n' : '';
codeSnippet += options.includeBoilerplate ? 'dispatchMain()\n' : '';

return callback(null, codeSnippet);
Expand Down

0 comments on commit b6532fb

Please sign in to comment.