Difference between revisions of "Talk:WebAPI/Feedback"

From Team Fortress Wiki
Jump to: navigation, search
(Created page with '== Suggestions == See User:STUART/WebAPI --~~~~ == Problems == I'm still seeing "TF_Unique_Achievement_FireAxe1" returned from GetSchema. --~~~~')
 
Line 1: Line 1:
 
== Suggestions ==
 
== Suggestions ==
 +
=== Things that should be fixed in the Steam Web API system ===
 +
*JSON and VDF should use arrays rather than objects containing arrays. Having them structured differently from XML complicates code unnecessarily (and result.items.item[1] is redundant compared to results.items[1]). This seems to have been designed to preserve the element name used for the individual objects in XML (allowing multiple arrays to be defined in the event of mixed types, which should be structured as multiple arrays in XML as well). When everything in an array is of the same class, nobody in JSON cares about that class's name (only its index in the containing array, and anybody using VDF is using code that was written for the original data file, which ''is'' structured this way.
 +
 +
Short version: this
 +
 +
  "result": {
 +
    "status": 1,
 +
    "items": {
 +
      "item": [
 +
        {
 +
          "id": 18446744073709019323,
 +
          "defindex": 125,
 +
          "level": 1,
 +
          "quality": 3,
 +
          "inventory": 2149580806,
 +
          "quantity": 1
 +
        },
 +
        {
 +
          "id": 1029705,
 +
          "defindex": 36,
 +
          "level": 5,
 +
          "quality": 3,
 +
          "inventory": 2147483655,
 +
          "quantity": 1
 +
        },
 +
      ]
 +
    }
 +
  }
 +
 +
should look like this:
 +
 +
  "result": {
 +
    "status": 1,
 +
    "items": [
 +
      {
 +
        "id": 18446744073709019323,
 +
        "defindex": 125,
 +
        "level": 1,
 +
        "quality": 3,
 +
        "inventory": 2149580806,
 +
        "quantity": 1
 +
      },
 +
      {
 +
        "id": 1029705,
 +
        "defindex": 36,
 +
        "level": 5,
 +
        "quality": 3,
 +
        "inventory": 2147483655,
 +
        "quantity": 1
 +
      },
 +
    ]
 +
  }
 +
 
See [[User:STUART/WebAPI]] --[[User:STUART|STUART]] 03:50, 5 July 2010 (UTC)
 
See [[User:STUART/WebAPI]] --[[User:STUART|STUART]] 03:50, 5 July 2010 (UTC)
 +
 
== Problems ==
 
== Problems ==
 
I'm still seeing "TF_Unique_Achievement_FireAxe1" returned from GetSchema. --[[User:STUART|STUART]] 03:50, 5 July 2010 (UTC)
 
I'm still seeing "TF_Unique_Achievement_FireAxe1" returned from GetSchema. --[[User:STUART|STUART]] 03:50, 5 July 2010 (UTC)

Revision as of 04:09, 5 July 2010

Suggestions

Things that should be fixed in the Steam Web API system

  • JSON and VDF should use arrays rather than objects containing arrays. Having them structured differently from XML complicates code unnecessarily (and result.items.item[1] is redundant compared to results.items[1]). This seems to have been designed to preserve the element name used for the individual objects in XML (allowing multiple arrays to be defined in the event of mixed types, which should be structured as multiple arrays in XML as well). When everything in an array is of the same class, nobody in JSON cares about that class's name (only its index in the containing array, and anybody using VDF is using code that was written for the original data file, which is structured this way.

Short version: this

 "result": {
   "status": 1,
   "items": {
     "item": [
       {
         "id": 18446744073709019323,
         "defindex": 125,
         "level": 1,
         "quality": 3,
         "inventory": 2149580806,
         "quantity": 1
       },
       {
         "id": 1029705,
         "defindex": 36,
         "level": 5,
         "quality": 3,
         "inventory": 2147483655,
         "quantity": 1
       },
     ]
   }
 }

should look like this:

 "result": {
   "status": 1,
   "items": [
     {
       "id": 18446744073709019323,
       "defindex": 125,
       "level": 1,
       "quality": 3,
       "inventory": 2149580806,
       "quantity": 1
     },
     {
       "id": 1029705,
       "defindex": 36,
       "level": 5,
       "quality": 3,
       "inventory": 2147483655,
       "quantity": 1
     },
   ]
 }

See User:STUART/WebAPI --STUART 03:50, 5 July 2010 (UTC)

Problems

I'm still seeing "TF_Unique_Achievement_FireAxe1" returned from GetSchema. --STUART 03:50, 5 July 2010 (UTC)