kibana/style_guides/api_style_guide.md
CJ Cenizal 9d8776b199 Add style_guides dir, extracted sections from STYLEGUIDE.md.
- css_style_guidee.md
- js_style_guide.md
- html_style_guide.md
- api_style_guide.md
2016-06-09 08:13:35 -07:00

689 B

Api Style Guide

Paths

API routes must start with the /api/ path segment, and should be followed by the plugin id if applicable:

Right: /api/marvel/v1/nodes Wrong: /marvel/api/v1/nodes

Versions

Kibana won't be supporting multiple API versions, so API's should not define a version.

Right: /api/kibana/index_patterns Wrong: /api/kibana/v1/index_patterns

snake_case

Kibana uses snake_case for the entire API, just like Elasticsearch. All urls, paths, query string parameters, values, and bodies should be snake_case formatted.

Right:

POST /api/kibana/index_patterns
{
  "id": "...",
  "time_field_name": "...",
  "fields": [
    ...
  ]
}