Open catgirlkara opened 2 months ago
Also just wanted to say that your API is amazing and easy to use! Thanks <3
Hey, thanks for the bug report, could you please tell me which version of the library you are using?
i pulled the latest i could find on nuget. looks like 4.0.0-beta?
I rolled back to 3.6.0 and Safebooru works! TY
Good to know, I'll still have a look at beta to see if I can do something, thanks
var booru = new BooruSharp.Booru.Safebooru(); PostSearchResult? result = null; try { result = await booru.GetRandomPostAsync(); } catch (Exception e) { Console.WriteLine(e); }
Throws this exception:
System.Text.Json.JsonException: The JSON value could not be converted to System.String. Path: $[0].directory | LineNumber: 0 | BytePositionInLine: 336. ---> System.InvalidOperationException: Cannot get the value of a token type 'Number' as a string. at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType) at System.Text.Json.Utf8JsonReader.GetString() at System.Text.Json.Serialization.Metadata.JsonPropertyInfo
1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter
1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonCollectionConverter
2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonConverter
1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) --- End of inner exception stack trace --- at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan
1 utf8Json, JsonTypeInfo1 jsonTypeInfo, Nullable
1 actualByteCount) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo
1 jsonTypeInfo) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at BooruSharp.Booru.ABooru.GetDataAsync[T](Uri url) at BooruSharp.Booru.Template.Gelbooru02.GetPostSearchResultAsync(Uri uri) at BooruSharp.Booru.ABooru.GetRandomPostAsync(String[] tagsArg)