Skip to content

Commit 8cd754d

Browse files
authored
[Docs] remove duplicated content from .yaml pages (#1292)
* [Docs] remove duplicated content from .yaml pages * add empty description fields * try empty strings * update linting rules * include content from openapi yaml files that were missing from md files
1 parent a22a38e commit 8cd754d

11 files changed

+56
-530
lines changed

openapi/openapi.config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ lint:
1818
info-license: off
1919
paths-kebab-case: off
2020
boolean-parameter-prefixes: off
21+
operation-description: off
2122

2223
# Todo: fix these offenders
2324
operation-tag-defined: off

openapi/src/connectors.openapi.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ paths:
2424
tags:
2525
- Retrieve Connectors
2626
summary: List Connectors
27-
description:
28-
$ref: './docs/connectors/list-connectors.md'
27+
description: ''
2928
operationId: get-connectors
3029
responses:
3130
'200':
@@ -38,8 +37,7 @@ paths:
3837
tags:
3938
- Create Connectors
4039
summary: Create Connector
41-
description:
42-
$ref: './docs/connectors/create-connector.md'
40+
description: ''
4341
operationId: create-connector
4442
requestBody:
4543
content:
@@ -97,8 +95,7 @@ paths:
9795
tags:
9896
- Delete Connectors
9997
summary: Delete a Project's Connector by Connector Id
100-
description:
101-
$ref: './docs/connectors/delete-connector.md'
98+
description: ''
10299
operationId: delete-connector
103100
responses:
104101
'200':
@@ -118,8 +115,7 @@ paths:
118115
tags:
119116
- Retrieve Connectors
120117
summary: List Connector Logs
121-
description:
122-
$ref: './docs/connectors/get-history.md'
118+
description: ''
123119
operationId: get-connector-logs
124120
responses:
125121
'200':

openapi/src/data-pipelines.openapi.yaml

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,7 @@ paths:
6060
- Create Pipelines
6161
operationId: create-warehouse-pipeline
6262
summary: Create Pipeline
63-
description: >
64-
This request creates an export pipeline. The `type` parameter defines
65-
the kind of pipeline that is initiated. Note that only 2 recurring and 1
66-
non-recurring events pipelines (**data_source**: `events`) are allowed
67-
per project.
68-
69-
70-
Create API returns the name of the pipeline created. Use the name of the
71-
pipeline to check the status of or cancel the pipeline.
63+
description: ''
7264
requestBody:
7365
required: true
7466
content:
@@ -252,38 +244,7 @@ paths:
252244
summary: Get Pipeline
253245
tags:
254246
- Retrieve Pipelines
255-
256-
description: |
257-
Given the name of the pipeline this API returns the status of the
258-
pipeline. It returns the summary and status of all the recent run export
259-
jobs for the pipeline.
260-
261-
262-
**Example Response:** Status with no Summary and a Filter
263-
264-
```curl
265-
curl https://data.mixpanel.com/api/2.0/nessie/pipeline/status \
266-
-u API_SECRET: \
267-
-d name="YOUR_PIPELINE_NAME" \
268-
-d status="running"
269-
```
270-
271-
**Example Response:** Status with no Summary and a Filter
272-
273-
```json
274-
{
275-
"canceled": [
276-
{
277-
"name": "company-july-2016-backfill-hourly-monoschema",
278-
"state": "canceled",
279-
"last_finish": "0000-12-31T16:00:00-08:00",
280-
"run_at": "2016-07-26T00:00:00-07:00",
281-
"from_date": "2016-07-26T00:00:00-07:00",
282-
"to_date": "2016-07-26T00:00:00-07:00"
283-
},
284-
}
285-
```
286-
247+
description: ''
287248
parameters:
288249
- $ref: ./common/parameters.yaml#/query/projectId
289250
- in: query

openapi/src/identity.openapi.yaml

Lines changed: 3 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -29,61 +29,7 @@ paths:
2929
- Identities
3030
summary: Create Identity
3131
operationId: create-identity
32-
description: |
33-
[block:callout]
34-
{
35-
"type": "info",
36-
"body": "You can also use the import endpoint: https://api.mixpanel.com/import/"
37-
}
38-
[/block]
39-
40-
**Identify Criteria:**
41-
[block:image]
42-
{
43-
"images": [
44-
{
45-
"image": [
46-
"https://files.readme.io/d0066f0-ID_management_identify_3-HTTP.png",
47-
"Identity Management - Identify",
48-
960,
49-
697,
50-
"#cad5da"
51-
]
52-
}
53-
]
54-
}
55-
[/block]
56-
57-
**Required [Event Object](https://docs.mixpanel.com/docs/how-it-works/concepts#anatomy-of-an-event) attributes**
58-
59-
[block:parameters]
60-
{
61-
"data": {
62-
"h-0": "Event Object property",
63-
"h-1": "Type",
64-
"h-2": "Description",
65-
"0-0": "**event**",
66-
"0-1": "<span style=\"font-family: courier\">String</span></br><span style=\"color: red\">required</span>",
67-
"0-2": "value must be: `$identify`",
68-
"1-0": "**properties**",
69-
"1-1": "<span style=\"font-family: courier\">Object</span></br><span style=\"color: red\">required</span>",
70-
"2-0": "**properties.distinct_id**",
71-
"2-1": "<span style=\"font-family: courier\">String</span></br><span style=\"color: green\">optional</span>",
72-
"2-2": "The distinct ID post-identification (same as $identified_id - it will be inferred from $identified_id if not included)",
73-
"3-0": "**properties.$identified_id**",
74-
"3-1": "<span style=\"font-family: courier\">String</span></br><span style=\"color: red\">required</span>",
75-
"3-2": "A distinct_id to merge with the $anon_id.",
76-
"4-0": "**properties.$anon_id**",
77-
"4-1": "<span style=\"font-family: courier\">String</span></br><span style=\"color: red\">required</span>",
78-
"4-2": "A distinct_id to merge with the $identified_id. The $anon_id must be [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier) format and not already merged to an $identified_id.",
79-
"5-0": "**properties.token**",
80-
"5-1": "<span style=\"font-family: courier\">String</span></br><span style=\"color: red\">required</span>",
81-
"5-2": "The project token."
82-
},
83-
"cols": 3,
84-
"rows": 6
85-
}
86-
[/block]
32+
description: ''
8733
requestBody:
8834
required: true
8935
content:
@@ -122,65 +68,7 @@ paths:
12268
- Identities
12369
summary: Create Alias
12470
operationId: identity-create-alias
125-
description: |
126-
[block:callout]
127-
{
128-
"type": "info",
129-
"body": "You can also use the import endpoint: https://api.mixpanel.com/import/"
130-
}
131-
[/block]
132-
133-
Mixpanel supports adding an alias to a distinct id. An alias is a new
134-
value that will be interpreted by Mixpanel as an existing value. That
135-
means that you can send messages to Mixpanel using the new value, and
136-
Mixpanel will continue to use the old value for calculating funnels and
137-
retention reports, or applying updates to user profiles.
138-
139-
**Alias Criteria:**
140-
[block:image]
141-
{
142-
"images": [
143-
{
144-
"image": [
145-
"https://files.readme.io/d16f1d3-ID_management_alias_3-HTTP.png",
146-
"Identity Management - Alias",
147-
960,
148-
697,
149-
"#cad5da"
150-
]
151-
}
152-
]
153-
}
154-
[/block]
155-
156-
**Required [Event Object](https://docs.mixpanel.com/docs/how-it-works/concepts#anatomy-of-an-event) attributes**
157-
158-
[block:parameters]
159-
{
160-
"data": {
161-
"h-0": "Event Object property",
162-
"h-1": "Type",
163-
"h-2": "Description",
164-
"0-0": "**event**",
165-
"0-1": "<span style=\"font-family: courier\">String</span></br><span style=\"color: red\">required</span>",
166-
"0-2": "value must be: `$create_alias`",
167-
"1-0": "**properties**",
168-
"1-1": "<span style=\"font-family: courier\">Object</span></br><span style=\"color: red\">required</span>",
169-
"2-0": "**properties.distinct_id**",
170-
"2-1": "<span style=\"font-family: courier\">String</span></br><span style=\"color: red\">required</span>",
171-
"2-2": "A distinct_id to be merged with the alias.",
172-
"3-0": "**properties.alias**",
173-
"3-1": "<span style=\"font-family: courier\">String</span></br><span style=\"color: red\">required</span>",
174-
"3-2": "A new distinct_id to be merged with the original distinct_id. Each alias can only map to one distinct_id.",
175-
"4-0": "**properties.token**",
176-
"4-1": "<span style=\"font-family: courier\">String</span></br><span style=\"color: red\">required</span>",
177-
"4-2": "The project token."
178-
},
179-
"cols": 3,
180-
"rows": 5
181-
}
182-
[/block]
183-
71+
description: ''
18472
requestBody:
18573
required: true
18674
content:
@@ -218,35 +106,10 @@ paths:
218106
- Identities
219107
summary: Merge Identities
220108
operationId: identity-merge
109+
description: ''
221110
security:
222111
- ServiceAccount: []
223112
- ProjectSecret: []
224-
description: |
225-
[block:callout]
226-
{
227-
"type": "danger",
228-
"title": "Merging identities is irreversible",
229-
"body": "`$merge` is a very powerful tool, so we will only accept `$merge` events that are sent via `https://api.mixpanel.com/import`, which is protected by the project api secret. You **cannot** unmerge `distinct_id`."
230-
}
231-
[/block]
232-
233-
**Merge Criteria:**
234-
235-
[block:image]
236-
{
237-
"images": [
238-
{
239-
"image": [
240-
"https://files.readme.io/be66940-merge_.png",
241-
"Identity Management - Merge",
242-
960,
243-
446,
244-
"#d0d7d3"
245-
]
246-
}
247-
]
248-
}
249-
[/block]
250113
parameters:
251114
- in: query
252115
name: strict

openapi/src/ingestion.openapi.yaml

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,70 +1188,7 @@ paths:
11881188
security:
11891189
- ServiceAccount: []
11901190
summary: Replace a Lookup Table
1191-
description: |
1192-
Replace the contents of an existing Lookup Table.
1193-
***
1194-
Lookup Tables must be [created via our UI](https://docs.mixpanel.com/docs/data-structure/lookup-tables#how-do-i-upload-a-lookup-table). Once a Lookup Table is created, its contents can be replaced via this API.
1195-
[block:api-header]
1196-
{
1197-
"title": "Validation"
1198-
}
1199-
[/block]
1200-
* The first column of the lookup table is assumed to be the ID of the row. All ID values must be unique.
1201-
* The first row of the lookup table is a header row. The values in the header must be unique, as each one uniquely identifies a column of the table. These will appear as properties of the lookup table in Mixpanel's UI.
1202-
* The CSV must be valid according to [RFC4180](https://datatracker.ietf.org/doc/html/rfc4180).
1203-
* If the `Content-Encoding: gzip` header is supplied, the table will be decompressed before parsing.
1204-
1205-
[block:api-header]
1206-
{
1207-
"title": "Types"
1208-
}
1209-
[/block]
1210-
* Integers or floats will be parsed as numbers.
1211-
* [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339) timestamps (`2021-08-21T05:36:01Z`) will parsed as datetimes.
1212-
* `true` or `false` (case-insensitive) will be parsed as boolean.
1213-
* Empty fields (two adjacent commas) will be treated as `undefined`
1214-
* Comma separated, quoted strings in square brackets (`"["Free","Paid","Enterprise"]"`) will be parsed as list of strings.
1215-
* All other values will be treated as strings.
1216-
1217-
[block:code]
1218-
{
1219-
"codes": [
1220-
{
1221-
"code": "id,artist,genre,is_platinum,name,num_listens,release_date,is_top_40,countries\nc994bb,Drake,Pop,True,Hotline Bling,1700000000,2015-10-18T22:00:00,true,[]\nd8d949,Gipsy Kings,Flamenco,False,Bamboleo,1170000,1987-07-12T05:00:00,false,\"[\"\"US\"\",\"\"CA\"\"]\"\na43fb8,Daft Punk,House,False,Aerodynamic,41000000,2001-03-12T07:30:00,false,\"[\"\"IN\"\"]\"\n",
1222-
"language": "text",
1223-
"name": "sample.csv"
1224-
}
1225-
]
1226-
}
1227-
[/block]
1228-
1229-
[block:api-header]
1230-
{
1231-
"title": "Errors"
1232-
}
1233-
[/block]
1234-
Lookup Tables are replaced in their entirety or not replaced at all. When the Lookup Table fails to meet the above validation, we return an error that looks as follows:
1235-
[block:code]
1236-
{
1237-
"codes": [
1238-
{
1239-
"code": "{\n \"error\": \"some data points in the request failed validation\",\n \"failed_records\": [\n {\n \"index\": 2,\n \"message\": \"invalid row: row indexes 1 and 2 have the same primary key\"\n },\n {\n \"index\": 3,\n \"message\": \"invalid row: wrong number of fields\"\n }\n ],\n \"status\": 0\n}",
1240-
"language": "json"
1241-
}
1242-
]
1243-
}
1244-
[/block]
1245-
We will return at most the first 10 rows that failed validation.
1246-
[block:api-header]
1247-
{
1248-
"title": "Limits"
1249-
}
1250-
[/block]
1251-
This endpoint will return a 429 error if called more than 100 times in a rolling 24 hour window. We recommend updating lookup tables at most hourly to stay within this limit.
1252-
1253-
This endpoint will return a 413 error if a Lookup Table exceeds 100MB uncompressed. In practice, this translates to 1-2M rows. If you have a lookup table that exceeds the limit, we recommend pruning the number of columns to those that are useful to analysis. Removing long URLs or user-generated content can bring a lookup table within this limit. If you still exceed the limit, please reach out to us at [email protected] -- we'd love to hear your use case!
1254-
1191+
description: ''
12551192
parameters:
12561193
- in: path
12571194
name: id

0 commit comments

Comments
 (0)