Skip to content

Commit

Permalink
Generate net client with v7, fix #46
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertuya committed Sep 22, 2023
1 parent d3a7c19 commit 4f6a74c
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 200 deletions.
3 changes: 0 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ updates:

- package-ecosystem: nuget
directory: "/net"
#avoids updates that cause not compilable code
ignore:
- dependency-name: "RestSharp"
update-types: ["version-update:semver-major"]
- dependency-name: "Microsoft.Data.SQLite"
schedule:
interval: weekly
Expand Down
3 changes: 3 additions & 0 deletions net/OpenApiPostprocess/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ private string SetterName(string name)
//las palabras reservadas originan propiedades con _ delante, quita este del nombre cuando genera setters y getters
if (name.StartsWith("_"))
name = name.Substring(1, name.Length-1);
//as of generator v7 some properties get the prefix Var, only for Version at the moment
else if (name == "VarVersion")
name = "Version";
return name;
}
// Ensures line endings compatible with generated code
Expand Down
279 changes: 139 additions & 140 deletions net/TdRules/Giis.Tdrules.Openapi/Client/ApiClient.cs

Large diffs are not rendered by default.

29 changes: 27 additions & 2 deletions net/TdRules/Giis.Tdrules.Openapi/Client/Configuration.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions net/TdRules/Giis.Tdrules.Openapi/Client/IReadableConfiguration.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 0 additions & 36 deletions net/TdRules/Giis.Tdrules.Openapi/Giis.Tdrules.Openapi.csproj

This file was deleted.

26 changes: 13 additions & 13 deletions net/TdRules/Giis.Tdrules.Openapi/Model/TdRules.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion net/TdRules/TdRules.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

<PackageReference Include="RestSharp" Version="108.0.3" />
<PackageReference Include="RestSharp" Version="110.2.0" />

<PackageReference Include="Polly" Version="7.2.4" />

Expand Down
11 changes: 6 additions & 5 deletions net/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,7 @@
<sequential>
<mkdir dir="sharpen-temp/lib"/>
<xmlproperty file="../pom.xml"/>
<!-- issue: #46, still not ready to oag v7.0.0
<property name="OAG_VERSION" value="${project.properties.openapi.generator.version}" />
-->
<property name="OAG_VERSION" value="6.6.0" />
<echo>Using openapi generator version ${OAG_VERSION}</echo>
<get src="https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/${OAG_VERSION}/openapi-generator-cli-${OAG_VERSION}.jar"
dest="sharpen-temp/lib/openapi-generator-cli-${OAG_VERSION}.jar" usetimestamp="true" />
Expand All @@ -283,15 +280,19 @@
<arg value="--input-spec" />
<arg value="sharpen-temp/openapi/api.yml" />
<arg value="--generator-name" />
<arg value="csharp-netcore" />
<arg value="csharp" />
<arg value="--additional-properties" />
<arg value="nullableReferenceTypes=false" />
<arg value="--output" />
<arg value="sharpen-temp/openapi" />
<arg value="--package-name" />
<arg value="Giis.Tdrules.Openapi" />
</exec>
<!--Copia y remplaza namespaces, a diferencia de java, no pone los especificados debajo de Org.openAPITools e Invoker se llama Client -->
<copy todir="TdRules/Giis.Tdrules.Openapi" flatten="false" includeEmptyDirs="false" >
<fileset dir="sharpen-temp/openapi/src/Giis.Tdrules.Openapi/" />
<fileset dir="sharpen-temp/openapi/src/Giis.Tdrules.Openapi/" >
<exclude name="*.csproj" />
</fileset>
</copy>

<!--Postprocessing: add getters and setters to the model for java compatibility-->
Expand Down

0 comments on commit 4f6a74c

Please sign in to comment.