Giter VIP home page Giter VIP logo

deviantartfs's Issues

Inconsistencies in deviation object format result in deserialization error

Hello, while using DeviantArtFs.Api.Browse.PageNewestAsync method I have noticed that there is an inconsisency in returned deviation objects which results in the following error:

FSharp.Json.JsonDeserializationError: JSON Path: results[117].tier.stats. Failed to parse record from JSON that is not object.
   at FSharp.Json.Core.failDeserialization[a](JsonPath path, String message)
   at FSharp.Json.Core.deserializeRecord@463(JsonConfig config, JsonPath path, Type t, JsonValue jvalue)
   at FSharp.Json.Core.deserializeNonOption@322(JsonConfig config, JsonPath path, Type t, JsonField jsonField, JsonValue jvalue)
   at FSharp.Json.Core.deserializeUnwrapOption@376(JsonConfig config, JsonPath path, Type t, JsonField jsonField, FSharpOption`1 jvalue)
   at FSharp.Json.Core.deserializeRecord@463(JsonConfig config, JsonPath path, Type t, JsonValue jvalue)
   at FSharp.Json.Core.deserializeNonOption@322(JsonConfig config, JsonPath path, Type t, JsonField jsonField, JsonValue jvalue)
   at FSharp.Json.Core.deserializeUnwrapOption@376(JsonConfig config, JsonPath path, Type t, JsonField jsonField, FSharpOption`1 jvalue)
   at FSharp.Json.Core.deserializeRecord@463(JsonConfig config, JsonPath path, Type t, JsonValue jvalue)
   at FSharp.Json.Core.deserializeNonOption@322(JsonConfig config, JsonPath path, Type t, JsonField jsonField, JsonValue jvalue)
   at Microsoft.FSharp.Collections.ArrayModule.MapIndexed[T,TResult](FSharpFunc`2 mapping, T[] array) in D:\a\_work\1\s\src\FSharp.Core\array.fs:line 453
   at FSharp.Json.Core.deserializeList@420(JsonConfig config, JsonPath path, Type t, JsonValue jvalue)
   at FSharp.Json.Core.deserializeNonOption@322(JsonConfig config, JsonPath path, Type t, JsonField jsonField, JsonValue jvalue)
   at FSharp.Json.Core.deserializeRecord@463(JsonConfig config, JsonPath path, Type t, JsonValue jvalue)
   at FSharp.Json.Json.deserializeEx[T](JsonConfig config, String json)
   at [email protected]()

Here is the problematic tier object in question:

			"tier": {
				"state": "active",
				"is_user_subscribed": false,
				"can_user_subscribe": true,
				"subproductid": 569102470,
				"dollar_price": "5.00",
				"settings": {
					"access_settings": "all"
				},
				"stats": [],
				"benefits": [
					"Welcome Gift!",
					"Early Access to New Work",
					"Over 2k Resolution Images"
				]
			},

As you can see, despite documentation mentioning it can only be an object, for some reason they are returning array for stats and I guess that's why deserialization error is happening. I have also tested this with /deviation/#GUID# endpoint and it returns the same out of spec object, so this seems to be an issue in all of their api endpoints which return deviation object.

I'm not sure if you can do something about that, but I thought it's worth letting you know about this issue.

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.