@team-supercharge/oasg 14.1.0-feature-csharp-functions-0f8dba22.0 → 14.1.0-feature-csharp-functions-win-ffd21d9f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/exec.js +11 -0
- package/bin/oasg +11 -10
- package/package.json +1 -1
- package/targets/common.sh +8 -5
- package/targets/dotnet/generator-config.json +4 -1
package/README.md
CHANGED
@@ -808,7 +808,7 @@ describe('Auth', function () {
|
|
808
808
|
"sourceUrl": "https://api.nuget.org/v3/index.json",
|
809
809
|
"apiKey": "apiKey",
|
810
810
|
"packageName": "packageName",
|
811
|
-
"generatorCustomArgs": "--global-property=supportingFiles,modelDocs --additional-properties=nullableReferenceTypes=
|
811
|
+
"generatorCustomArgs": "--global-property=supportingFiles,modelDocs --additional-properties=nullableReferenceTypes=false"
|
812
812
|
}
|
813
813
|
```
|
814
814
|
|
package/bin/exec.js
CHANGED
@@ -11,4 +11,15 @@ function exec(command, stdio) {
|
|
11
11
|
}
|
12
12
|
}
|
13
13
|
|
14
|
+
function bash(command, stdio) {
|
15
|
+
try {
|
16
|
+
execSync(`bash -e -c "${command}"`, { stdio: stdio || 'inherit' });
|
17
|
+
}
|
18
|
+
catch (e) {
|
19
|
+
console.error(e.message);
|
20
|
+
exit(1);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
14
24
|
exports.exec = exec;
|
25
|
+
exports.bash = bash;
|
package/bin/oasg
CHANGED
@@ -15,6 +15,7 @@ const expressHttpProxy = require('express-http-proxy');
|
|
15
15
|
const { exit } = require('process');
|
16
16
|
|
17
17
|
const { exec } = require(`${__dirname}/exec.js`);
|
18
|
+
const { bash } = require(`${__dirname}/exec.js`);
|
18
19
|
const { merge } = require(`${__dirname}/merger.js`);
|
19
20
|
const { applyOverrides } = require(`${__dirname}/overrider.js`);
|
20
21
|
const { openApiTarget } = require(`${__dirname}/openapi-target.js`);
|
@@ -550,9 +551,9 @@ function fetchBinary(target) {
|
|
550
551
|
|
551
552
|
// download binary
|
552
553
|
console.log(`... downloading ${binary.url} ==> ${binaryPath}`);
|
553
|
-
|
554
|
-
|
555
|
-
|
554
|
+
bash(`mkdir -p ${BIN_FOLDER}`);
|
555
|
+
bash(`wget ${binary.url} -q -O ${binaryPath}`);
|
556
|
+
bash(`chmod +x ${binaryPath}`);
|
556
557
|
return binaryPath;
|
557
558
|
}
|
558
559
|
|
@@ -583,9 +584,9 @@ function fetchFormatter(target) {
|
|
583
584
|
|
584
585
|
// download binary
|
585
586
|
console.log(`... downloading ${binary.url} ==> ${binaryPath}`);
|
586
|
-
|
587
|
-
|
588
|
-
|
587
|
+
bash(`mkdir -p ${BIN_FOLDER}`);
|
588
|
+
bash(`wget ${binary.url} -q -O ${binaryPath}`);
|
589
|
+
bash(`chmod +x ${binaryPath}`);
|
589
590
|
return binaryPath;
|
590
591
|
}
|
591
592
|
|
@@ -596,12 +597,12 @@ function customizeTemplates(target) {
|
|
596
597
|
const targetTemplateDir = `${__dirname}/../targets/${target.type}/templates`;
|
597
598
|
|
598
599
|
if (fs.existsSync(templateDir)) {
|
599
|
-
|
600
|
+
bash(`rm -rf ${templateDir}`);
|
600
601
|
}
|
601
|
-
|
602
|
+
bash(`mkdir -p ${templateDir}`);
|
602
603
|
|
603
604
|
if (fs.existsSync(targetTemplateDir)) {
|
604
|
-
|
605
|
+
bash(`cp -R ${targetTemplateDir}/* ${templateDir}`);
|
605
606
|
}
|
606
607
|
|
607
608
|
if (target.templateDir) {
|
@@ -610,7 +611,7 @@ function customizeTemplates(target) {
|
|
610
611
|
exit(1);
|
611
612
|
}
|
612
613
|
|
613
|
-
|
614
|
+
bash(`cp -R ${target.templateDir}/* ${templateDir}`);
|
614
615
|
}
|
615
616
|
|
616
617
|
return templateDir;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@team-supercharge/oasg",
|
3
|
-
"version": "14.1.0-feature-csharp-functions-
|
3
|
+
"version": "14.1.0-feature-csharp-functions-win-ffd21d9f.0",
|
4
4
|
"description": "Node-based tool to lint OpenAPI documents and generate clients, servers and documentation from them",
|
5
5
|
"author": "Supercharge",
|
6
6
|
"license": "MIT",
|
package/targets/common.sh
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
1
3
|
# command line arguments:
|
2
4
|
# 1. version - semantic version string
|
3
5
|
# 2. binary - openapi-generator JAR file
|
@@ -21,10 +23,11 @@ templateDir=$9
|
|
21
23
|
|
22
24
|
echo -e "\n=====\n version:\t$version\n binary:\t$binary\n configFile:\t$configFile\n targetId:\t$targetId\n generatorId:\t$generatorId\n openApiFile:\t$openApiFile\n formatter:\t$formatterBinary\n preRelease:\t$preRelease\n templateDir:\t$templateDir\n ---"
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
blacklist='.id, .type, .source, .generator, .generatorId, .templateDir'
|
27
|
+
|
28
|
+
params=$(jq -r ".targets[] | select(.id == \"$targetId\") | del($blacklist) | to_entries | map(\"\(.key)=\(.value | @sh);\") | .[]" $configFile)
|
29
|
+
|
30
|
+
echo "$params"
|
31
|
+
eval $params
|
29
32
|
|
30
33
|
echo -e "=====\n"
|