https://bugzilla.wikimedia.org/show_bug.cgi?id=45303

       Web browser: ---
            Bug ID: 45303
           Summary: api.php ask response breaks sorting
           Product: MediaWiki extensions
           Version: REL1_20 branch
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Semantic MediaWiki
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
    Classification: Unclassified
   Mobile Platform: ---

he api response format loses the sorting order.

This is because "results" is returned as an object instead of as a list.

Currently the response has this structure

{"query":
  {"printrequests":[
     {"label":"","typeid":"_wpg","mode":2},                  
     {"label":"Allele1","typeid":"_str","mode":1},
     {"label":"Allele2","typeid":"_str","mode":1},
     {"label":"Magnitude","typeid":"_num","mode":1},
     {"label":"On chromosome","typeid":"_str","mode":1}],

   "results": {
      "Rs121964853(A;A)":
        {"printouts":{
            "Allele1":["A"],
            "Allele2":["A"],
            "Magnitude":[4],"On chromosome":["1"]
          },
        "fulltext":"Rs121964853(A;A)",
        "fullurl":"http:\/\/bots.snpedia.com\/index.php\/Rs121964853(A;A)"
        },

      "Rs121909520(G;G)":
        {"printouts":{
            "Allele1":["G"],
            "Allele2":["G"],
            "Magnitude":[4],
            "On chromosome"["1"]
         },
        "fulltext":"Rs121909520(G;G)",
        "fullurl":"http:\/\/bots.snpedia.com\/index.php\/Rs121909520(G;G)"},


...


I think a more correct structure would be


{"query":
  {"printrequests":[
     {"label":"","typeid":"_wpg","mode":2},                  
     {"label":"Allele1","typeid":"_str","mode":1},
     {"label":"Allele2","typeid":"_str","mode":1},
     {"label":"Magnitude","typeid":"_num","mode":1},
     {"label":"On chromosome","typeid":"_str","mode":1}],

   "results": [
        {"printouts":{
            "Allele1":["A"],
            "Allele2":["A"],
            "Magnitude":[4],"On chromosome":["1"]
          },
        "fulltext":"Rs121964853(A;A)",
        "fullurl":"http:\/\/bots.snpedia.com\/index.php\/Rs121964853(A;A)"
        },

        {"printouts":{
            "Allele1":["G"],
            "Allele2":["G"],
            "Magnitude":[4],
            "On chromosome"["1"]
         },
        "fulltext":"Rs121909520(G;G)",
        "fullurl":"http:\/\/bots.snpedia.com\/index.php\/Rs121909520(G;G)"},

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to