-- { "one_file": true }
{% for t in tables %}
{{ t.table_name }}
{{ "=" * len(t.table_name)}}
{% if t.comment %}Description: {{ t.comment }}{% endif %}

GET /{{ t.table_name }} List all existing {{ t.table_name }}s

Response:

200 Success
Media Type: application/json
{
  {{ t.table_name }}s: [
    {
      {% for c in t.columns.values() %}{{ c.name }}: {% if "BIGINT" in c.type %}0{% elif "FLOAT" in c.type %}"decimal"{% elif c.type == "INT" %}0{% elif "DECIMAL" in c.type %}"decimal"{% elif "TIME" in c.type %}"string"{% elif "VARCHAR" in c.type %}"string"{% elif "TEXT" in c.type %}"string"{% elif "TINYINT" in c.type %}true{% else %}"{{ c.type }}"{% endif %}{% if not loop.last %},
      {% endif %}{% if c.comment %}{% endif %}{% endfor %}
    }
  ]
}

GET /{{ t.table_name }}/<{{ t.table_name }}_id> Get an existing {{ t.table_name }}

Parameters:

{{ t.table_name }}_id

Response:

200 Success
Media Type: application/json
{
  {% for c in t.columns.values() %}{{ c.name }}: {% if "BIGINT" in c.type %}0{% elif "FLOAT" in c.type %}"decimal"{% elif c.type == "INT" %}0{% elif "DECIMAL" in c.type %}"decimal"{% elif "TIME" in c.type %}"string"{% elif "VARCHAR" in c.type %}"string"{% elif "TEXT" in c.type %}"string"{% elif "TINYINT" in c.type %}true{% else %}"{{ c.type }}"{% endif %}{% if not loop.last %},
  {% endif %}{% if c.comment %}{% endif %}{% endfor %}
}

POST /{{ t.table_name }} Create a new {{ t.table_name }}

Request Body:

{
  {% for c in t.columns.values() %}{{ c.name }}: {% if "BIGINT" in c.type %}0{% elif "FLOAT" in c.type %}"decimal"{% elif c.type == "INT" %}0{% elif "DECIMAL" in c.type %}"decimal"{% elif "TIME" in c.type %}"string"{% elif "VARCHAR" in c.type %}"string"{% elif "TEXT" in c.type %}"string"{% elif "TINYINT" in c.type %}true{% else %}"{{ c.type }}"{% endif %}{% if not loop.last %},
  {% endif %}{% if c.comment %}{% endif %}{% endfor %}
}

Response:

200 Success
Media Type: application/json
{
  {% for c in t.columns.values() %}{{ c.name }}: {% if "BIGINT" in c.type %}0{% elif "FLOAT" in c.type %}"decimal"{% elif c.type == "INT" %}0{% elif "DECIMAL" in c.type %}"decimal"{% elif "TIME" in c.type %}"string"{% elif "VARCHAR" in c.type %}"string"{% elif "TEXT" in c.type %}"string"{% elif "TINYINT" in c.type %}true{% else %}"{{ c.type }}"{% endif %}{% if not loop.last %},
  {% endif %}{% if c.comment %}{% endif %}{% endfor %}
}

PUT /{{ t.table_name }}/<{{ t.table_name }}_id> Update an existing {{ t.table_name }}

Request Body:

{
  {% for c in t.columns.values() %}{{ c.name }}: {% if "BIGINT" in c.type %}0{% elif "FLOAT" in c.type %}"decimal"{% elif c.type == "INT" %}0{% elif "DECIMAL" in c.type %}"decimal"{% elif "TIME" in c.type %}"string"{% elif "VARCHAR" in c.type %}"string"{% elif "TEXT" in c.type %}"string"{% elif "TINYINT" in c.type %}true{% else %}"{{ c.type }}"{% endif %}{% if not loop.last %},
  {% endif %}{% if c.comment %}{% endif %}{% endfor %}
}

Response:

200 Success
Media Type: application/json
{
  {% for c in t.columns.values() %}{{ c.name }}: {% if "BIGINT" in c.type %}0{% elif "FLOAT" in c.type %}"decimal"{% elif c.type == "INT" %}0{% elif "DECIMAL" in c.type %}"decimal"{% elif "TIME" in c.type %}"string"{% elif "VARCHAR" in c.type %}"string"{% elif "TEXT" in c.type %}"string"{% elif "TINYINT" in c.type %}true{% else %}"{{ c.type }}"{% endif %}{% if not loop.last %},
  {% endif %}{% if c.comment %}{% endif %}{% endfor %}
}

PATCH /{{ t.table_name }}/<{{ t.table_name }}_id> Update part of an existing {{ t.table_name }}

Request Body:

{
  {% for c in t.columns.values() %}{{ c.name }}: {% if "BIGINT" in c.type %}0{% elif "FLOAT" in c.type %}"decimal"{% elif c.type == "INT" %}0{% elif "DECIMAL" in c.type %}"decimal"{% elif "TIME" in c.type %}"string"{% elif "VARCHAR" in c.type %}"string"{% elif "TEXT" in c.type %}"string"{% elif "TINYINT" in c.type %}true{% else %}"{{ c.type }}"{% endif %}{% if not loop.last %},
  {% endif %}{% if c.comment %}{% endif %}{% endfor %}
}

Response:

200 Success
Media Type: application/json
{
  {% for c in t.columns.values() %}{{ c.name }}: {% if "BIGINT" in c.type %}0{% elif "FLOAT" in c.type %}"decimal"{% elif c.type == "INT" %}0{% elif "DECIMAL" in c.type %}"decimal"{% elif "TIME" in c.type %}"string"{% elif "VARCHAR" in c.type %}"string"{% elif "TEXT" in c.type %}"string"{% elif "TINYINT" in c.type %}true{% else %}"{{ c.type }}"{% endif %}{% if not loop.last %},
  {% endif %}{% if c.comment %}{% endif %}{% endfor %}
}

DELETE /{{ t.table_name }}/<{{ t.table_name }}_id> Delete an existing {{ t.table_name }}

Parameters:

{{ t.table_name }}_id

Response:

200 Success
Media Type: application/json
{
  "status": "OK"
}
{% endfor %}




