mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Docs: update annotations API docs to include required field (#52644)
* Update annotations.md A minor change to include the required fields when creating a new annotation via the annotations API. The error message when fields are missing is not descriptive and there is no indication in the current documentation (that I can see anyway) that would indicate these fields are required. * Update annotations.md Update required json body fields to only include fields that are actually required. * Add required field in Swagger Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
parent
920ee16b54
commit
c56aae6f63
@ -122,6 +122,10 @@ See note in the [introduction]({{< ref "#annotations-api" >}}) for an explanatio
|
|||||||
| ------------------ | ----------------------- |
|
| ------------------ | ----------------------- |
|
||||||
| annotations:create | annotations:type:<type> |
|
| annotations:create | annotations:type:<type> |
|
||||||
|
|
||||||
|
**Required JSON Body Fields**
|
||||||
|
|
||||||
|
- `text`: description of the annotation.
|
||||||
|
|
||||||
**Example Request**:
|
**Example Request**:
|
||||||
|
|
||||||
```http
|
```http
|
||||||
|
@ -8,6 +8,7 @@ type PostAnnotationsCmd struct {
|
|||||||
PanelId int64 `json:"panelId"`
|
PanelId int64 `json:"panelId"`
|
||||||
Time int64 `json:"time"`
|
Time int64 `json:"time"`
|
||||||
TimeEnd int64 `json:"timeEnd,omitempty"` // Optional
|
TimeEnd int64 `json:"timeEnd,omitempty"` // Optional
|
||||||
|
// required: true
|
||||||
Text string `json:"text"`
|
Text string `json:"text"`
|
||||||
Tags []string `json:"tags"`
|
Tags []string `json:"tags"`
|
||||||
Data *simplejson.Json `json:"data"`
|
Data *simplejson.Json `json:"data"`
|
||||||
|
@ -14150,6 +14150,7 @@
|
|||||||
},
|
},
|
||||||
"PostAnnotationsCmd": {
|
"PostAnnotationsCmd": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"required": ["text"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"dashboardId": {
|
"dashboardId": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
@ -12099,6 +12099,7 @@
|
|||||||
},
|
},
|
||||||
"PostAnnotationsCmd": {
|
"PostAnnotationsCmd": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"required": ["text"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"dashboardId": {
|
"dashboardId": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
Loading…
Reference in New Issue
Block a user