From 0e994eabf79bcbdcc4e498ab61bf4d24977730b8 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 29 Oct 2020 10:53:50 +0800 Subject: [PATCH] use WriteRawValue instead of WriteRaw (#7830) --- .../src/main/resources/csharp-netcore/modelAnyOf.mustache | 2 +- .../src/main/resources/csharp-netcore/modelOneOf.mustache | 2 +- .../OpenAPIClient/src/Org.OpenAPITools/Model/Fruit.cs | 2 +- .../OpenAPIClient/src/Org.OpenAPITools/Model/FruitReq.cs | 2 +- .../OpenAPIClient/src/Org.OpenAPITools/Model/GmFruit.cs | 2 +- .../OpenAPIClient/src/Org.OpenAPITools/Model/Mammal.cs | 2 +- .../OpenAPIClient/src/Org.OpenAPITools/Model/NullableShape.cs | 2 +- .../OpenAPIClient/src/Org.OpenAPITools/Model/Pig.cs | 2 +- .../OpenAPIClient/src/Org.OpenAPITools/Model/Quadrilateral.cs | 2 +- .../OpenAPIClient/src/Org.OpenAPITools/Model/Shape.cs | 2 +- .../OpenAPIClient/src/Org.OpenAPITools/Model/ShapeOrNull.cs | 2 +- .../OpenAPIClient/src/Org.OpenAPITools/Model/Triangle.cs | 2 +- .../OpenAPIClientCore/src/Org.OpenAPITools/Model/Fruit.cs | 2 +- .../OpenAPIClientCore/src/Org.OpenAPITools/Model/FruitReq.cs | 2 +- .../OpenAPIClientCore/src/Org.OpenAPITools/Model/GmFruit.cs | 2 +- .../OpenAPIClientCore/src/Org.OpenAPITools/Model/Mammal.cs | 2 +- .../src/Org.OpenAPITools/Model/NullableShape.cs | 2 +- .../OpenAPIClientCore/src/Org.OpenAPITools/Model/Pig.cs | 2 +- .../src/Org.OpenAPITools/Model/Quadrilateral.cs | 2 +- .../OpenAPIClientCore/src/Org.OpenAPITools/Model/Shape.cs | 2 +- .../OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeOrNull.cs | 2 +- .../OpenAPIClientCore/src/Org.OpenAPITools/Model/Triangle.cs | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache index 09b745284958..a08452016ece 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache @@ -190,7 +190,7 @@ /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache index 50b6116c99c0..e990614ba33a 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache @@ -219,7 +219,7 @@ /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Fruit.cs index e4f5b6cf3c60..3a643420fc74 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Fruit.cs @@ -236,7 +236,7 @@ public class FruitJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(Fruit).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(Fruit).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FruitReq.cs index c314694d61a7..fcc9414599e5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FruitReq.cs @@ -245,7 +245,7 @@ public class FruitReqJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(FruitReq).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(FruitReq).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GmFruit.cs index e9cacb9e86d8..77f133c78b34 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GmFruit.cs @@ -224,7 +224,7 @@ public class GmFruitJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(GmFruit).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(GmFruit).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Mammal.cs index c911f9c5b56b..afc5e3b9be88 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Mammal.cs @@ -293,7 +293,7 @@ public class MammalJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(Mammal).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(Mammal).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableShape.cs index 43e2848dcde9..3abbb9ef1c33 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableShape.cs @@ -261,7 +261,7 @@ public class NullableShapeJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(NullableShape).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(NullableShape).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pig.cs index 7ccbefdafda1..2a42a7b59077 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pig.cs @@ -252,7 +252,7 @@ public class PigJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(Pig).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(Pig).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Quadrilateral.cs index 40b00b9fa326..8644de3b73d1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -252,7 +252,7 @@ public class QuadrilateralJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(Quadrilateral).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(Quadrilateral).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Shape.cs index d360e2db2da6..41119708cfca 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Shape.cs @@ -252,7 +252,7 @@ public class ShapeJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(Shape).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(Shape).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeOrNull.cs index a0c2d480113c..f0f5d7da828c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -261,7 +261,7 @@ public class ShapeOrNullJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(ShapeOrNull).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(ShapeOrNull).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Triangle.cs index aa40d8aced32..9445efa26968 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Triangle.cs @@ -293,7 +293,7 @@ public class TriangleJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(Triangle).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(Triangle).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Fruit.cs index e4f5b6cf3c60..3a643420fc74 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Fruit.cs @@ -236,7 +236,7 @@ public class FruitJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(Fruit).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(Fruit).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FruitReq.cs index c314694d61a7..fcc9414599e5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FruitReq.cs @@ -245,7 +245,7 @@ public class FruitReqJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(FruitReq).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(FruitReq).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GmFruit.cs index e9cacb9e86d8..77f133c78b34 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GmFruit.cs @@ -224,7 +224,7 @@ public class GmFruitJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(GmFruit).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(GmFruit).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Mammal.cs index 3fe4a6ced999..126b44f3f1ff 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Mammal.cs @@ -275,7 +275,7 @@ public class MammalJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(Mammal).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(Mammal).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableShape.cs index 03a2c0b81078..5a05a571a889 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableShape.cs @@ -246,7 +246,7 @@ public class NullableShapeJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(NullableShape).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(NullableShape).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pig.cs index a2d64a876262..33c863795e3c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pig.cs @@ -237,7 +237,7 @@ public class PigJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(Pig).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(Pig).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Quadrilateral.cs index d71e30cfd03d..5e443d2f29f7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -237,7 +237,7 @@ public class QuadrilateralJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(Quadrilateral).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(Quadrilateral).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Shape.cs index c578d50a686c..5bd5724742ad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Shape.cs @@ -237,7 +237,7 @@ public class ShapeJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(Shape).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(Shape).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeOrNull.cs index f5415036a4da..f914a6c007bf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -246,7 +246,7 @@ public class ShapeOrNullJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(ShapeOrNull).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(ShapeOrNull).GetMethod("ToJson").Invoke(value, null))); } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Triangle.cs index e4648eca1ee8..0eda18d2bf80 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Triangle.cs @@ -275,7 +275,7 @@ public class TriangleJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRaw((String)(typeof(Triangle).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((String)(typeof(Triangle).GetMethod("ToJson").Invoke(value, null))); } ///