Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
morganleroi committed Feb 7, 2024
1 parent 4195970 commit a48fad7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions templates/csharp/modelOneOf.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
/// <param name="serializer">JSON Serializer</param>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
writer.WriteRawValue((string)(typeof({{classname}}{{#vendorExtensions.x-has-child-generic}}<object>{{/vendorExtensions.x-has-child-generic}}).GetMethod("ToJson")?.Invoke(value, null)));
writer.WriteRawValue((string)value?.GetType().GetMethod("ToJson")?.Invoke(value, null));
}

/// <summary>
Expand All @@ -257,7 +257,7 @@
{
if(reader.TokenType != JsonToken.Null)
{
return objectType.GetMethod("FromJson")?.Invoke(null, new object[] { JObject.Load(reader).ToString(Formatting.None) });
return objectType.GetMethod("FromJson")?.Invoke(null, new object[] { JToken.Load(reader).ToString(Formatting.None) });
}
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions templates/csharp/tests/requests/requests.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private readonly {{client}} _client{{#hasE2E}}, _e2eClient{{/hasE2E}};
[Fact(DisplayName = "{{{testName}}}")]
public async Task {{#lambda.pascalcase}}{{method}}Test{{testIndex}}{{/lambda.pascalcase}}()
{
await _client.{{#lambda.pascalcase}}{{method}}{{/lambda.pascalcase}}Async{{#isGeneric}}<Object>{{/isGeneric}}({{#parametersWithDataType}}{{> tests/generateParams}}{{^-last}},{{/-last}}{{/parametersWithDataType}}{{#hasRequestOptions}}, new RequestOptions(){
await _client.{{#lambda.pascalcase}}{{method}}{{/lambda.pascalcase}}Async{{#isGeneric}}<Hit>{{/isGeneric}}({{#parametersWithDataType}}{{> tests/generateParams}}{{^-last}},{{/-last}}{{/parametersWithDataType}}{{#hasRequestOptions}}, new RequestOptions(){
{{#requestOptions.queryParameters.parametersWithDataType}}
QueryParameters = new Dictionary<string, object>(){ {"{{{key}}}", {{> tests/requests/requestOptionsParams}} }},
{{/requestOptions.queryParameters.parametersWithDataType}}
Expand Down Expand Up @@ -101,7 +101,7 @@ private readonly {{client}} _client{{#hasE2E}}, _e2eClient{{/hasE2E}};
{{#response}}
// e2e
try {
var resp = await _e2eClient.{{#lambda.pascalcase}}{{method}}{{/lambda.pascalcase}}Async{{#isGeneric}}<Object>{{/isGeneric}}({{#parametersWithDataType}}{{> tests/generateParams}}{{^-last}},{{/-last}}{{/parametersWithDataType}}{{#hasRequestOptions}}, new RequestOptions(){
var resp = await _e2eClient.{{#lambda.pascalcase}}{{method}}{{/lambda.pascalcase}}Async{{#isGeneric}}<Hit>{{/isGeneric}}({{#parametersWithDataType}}{{> tests/generateParams}}{{^-last}},{{/-last}}{{/parametersWithDataType}}{{#hasRequestOptions}}, new RequestOptions(){
{{#requestOptions.queryParameters.parametersWithDataType}}
QueryParameters = new Dictionary<string, object>(){ {"{{{key}}}", {{> tests/requests/requestOptionsParams}} }},
{{/requestOptions.queryParameters.parametersWithDataType}}
Expand Down

0 comments on commit a48fad7

Please sign in to comment.