Giter VIP home page Giter VIP logo

Comments (3)

fenghen1001 avatar fenghen1001 commented on July 25, 2024 1

Hi,

I just call the method: ListLanguageTranslations and the app crashes.

crash line:
ResponseList<LanguageTranslations> langTranslations = await client.StringTranslations.ListLanguageTranslations(kCrowdInProjectId, "fr");

crash message:
Newtonsoft.Json.JsonSerializationException: "Could not create an instance of type Crowdin.Api.StringTranslations.LanguageTranslations. Type is an interface or abstract class and cannot be instantiated. Path 'stringId', line 2, position 13."
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator)\n at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)\n at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)\n at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)\n at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)\n at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)\n at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)\n at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)\n at Crowdin.Api.Core.JsonParser.ParseResponseObject[TData](JObject rootElement) in DOC/crowdin-api-client-dotnet-main/src/Crowdin.Api/Core/JsonParser.cs:line 53\n at Crowdin.Api.Core.JsonParser.ParseResponseObject[TData](JToken token) in DOC/crowdin-api-client-dotnet-main/src/Crowdin.Api/Core/JsonParser.cs:line 43\n at System.Linq.Enumerable.SelectIListIterator2.ToList()\n at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)\n at Crowdin.Api.Core.JsonParser.ParseResponseList[TData](JObject rootElement) in DOC/crowdin-api-client-dotnet-main/src/Crowdin.Api/Core/JsonParser.cs:line 58\n at Crowdin.Api.StringTranslations.StringTranslationsApiExecutor.d__12.MoveNext() in DOC/crowdin-api-client-dotnet-main/src/Crowdin.Api/StringTranslations/StringTranslationsApiExecutor.cs:line 144\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\n at $.<

$>d__0.MoveNext() in DOC/crowdin-api-client-dotnet-main/samples/Crowdin.Api.Samples/Program.cs:71

Thanks.

from crowdin-api-client-dotnet.

andrii-bodnar avatar andrii-bodnar commented on July 25, 2024

Hi @fenghen1001!

Could you please provide clear steps to reproduce this issue? Also please add the error message.

Thanks.

from crowdin-api-client-dotnet.

innomaxx avatar innomaxx commented on July 25, 2024

Hi @fenghen1001. Please check fix/language-translations branch and let me know if the issue is fixed or not.

Unfortunately we can't accept your suggested implementation, because there could be objects different by type in one response list. Please check runtime type and downcast each object to its end type separately

from crowdin-api-client-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.