Skip to content

docs on sql api response examples missing json key 'fields' #408

@andy-esch

Description

@andy-esch

In the SQL API docs, JSON responses include the keys time, rows, and total_rows, but lack 'fields' which describes the schema (field names and data types) of the response. An example is the response to this call: http://eschbacher.cartodb.com/api/v2/sql?q=select%20mag,place,time%20FROM%20all_month_3%20limit%201

{
  "rows": [
    {
      "mag": 0.22,
      "place": "15km S of Reno, Nevada",
      "time": "2015-02-15T01:35:33Z"
    }
  ],
  "time": 0.004,
  "fields": {
    "mag": {
      "type": "number"
    },
    "place": {
      "type": "string"
    },
    "time": {
      "type": "date"
    }
  },
  "total_rows": 1
}

I also noticed that the keys in the docs are not quoted, but valid JSON has quoted keys.

cc @csobier

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions