Skip to content

Commit

Permalink
feat [schema] adding docs for entity name in the query (#1735)
Browse files Browse the repository at this point in the history
* adding schema query doc

* using param

* adding optional name blurb

* using entity_name in query
  • Loading branch information
ytolstyk authored Jan 28, 2025
1 parent 32733b6 commit 6260a2f
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 53 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ All pull requests will generate a staging link in Vercel. Here's an [example](ht
You may also preview changes by [testing locally](#testing-locally)

# Nextra 3.0
We are now using [Nextra 3](https://the-guild.dev/blog/nextra-3), which is slightly different than Nextra 2. The main differences for most maintainers is that instead of _meta.json to generate custom sidebars, it is now in Javascript or Typescript, and can be rendered with components. Another difference is that `Tab` is now imported from `Tabs.Tab` and `Card` from `Cards.Card`, both from `nextra/components`.

We are now using [Nextra 3](https://the-guild.dev/blog/nextra-3), which is slightly different than Nextra 2. The main differences for most maintainers is that instead of \_meta.json to generate custom sidebars, it is now in Javascript or Typescript, and can be rendered with components. Another difference is that `Tab` is now imported from `Tabs.Tab` and `Card` from `Cards.Card`, both from `nextra/components`.

# Changelog

Expand All @@ -84,7 +85,7 @@ We make a changelog post for every feature we ship. It usually includes a Loom l

# Maintainers

[Marissa](https://github.com/marissakuhrau), [Mav](https://github.com/mavlee), [Isha](https://github.com/ishamehramixpanel), and [Myron](https://github.com/myronkaifung). Eventually we’ll expand this list, but keeping it tight for now.
[Marissa](https://github.com/marissakuhrau), [Isha](https://github.com/ishamehramixpanel), and [Myron](https://github.com/myronkaifung). Eventually we’ll expand this list, but keeping it tight for now.

# Review Process

Expand Down
108 changes: 58 additions & 50 deletions openapi/src/lexicon-schemas.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ info:
Use schemas to sync your data dictionary with Mixpanel. Schemas can be
used to populate Lexicon and provide additional context for your data.
contact:
url: 'https://mixpanel.com/get-support'
url: "https://mixpanel.com/get-support"
version: 1.0.0
servers:
- $ref: ./common/app-api.yaml#/server
Expand All @@ -31,22 +31,22 @@ paths:
summary: List Schemas
description: List all schemas in a project
responses:
'200':
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ListSchemasResponse'
'401':
$ref: "#/components/schemas/ListSchemasResponse"
"401":
$ref: ./common/responses.yaml#/401Unauthorized
'403':
"403":
$ref: ./common/responses.yaml#/403Forbidden
post:
operationId: upload-schemas-for-project
tags:
- Create Schemas
summary: Create/Replace Multiple
description: ''
description: ""
requestBody:
content:
application/json:
Expand All @@ -57,7 +57,7 @@ paths:
type: array
description: The list of schema entries to upload
items:
$ref: '#/components/schemas/SchemaEntry'
$ref: "#/components/schemas/SchemaEntry"
truncate:
type: boolean
description: >-
Expand All @@ -70,15 +70,15 @@ paths:
- entries
additionalProperties: false
responses:
'200':
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/BatchUploadSchemasResponse'
'401':
$ref: "#/components/schemas/BatchUploadSchemasResponse"
"401":
$ref: ./common/responses.yaml#/401Unauthorized
'403':
"403":
$ref: ./common/responses.yaml#/403Forbidden
delete:
operationId: delete-all-schemas-in-project
Expand All @@ -87,36 +87,37 @@ paths:
summary: Delete all Schemas
description: Delete all schemas in a project
responses:
'200':
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteSchemasResponse'
'401':
$ref: "#/components/schemas/DeleteSchemasResponse"
"401":
$ref: ./common/responses.yaml#/401Unauthorized
'403':
"403":
$ref: ./common/responses.yaml#/403Forbidden
/projects/{projectId}/schemas/{entityType}:
parameters:
- $ref: ./common/parameters.yaml#/path/projectId
- $ref: '#/components/parameters/schemaEntityType'
- $ref: "#/components/parameters/schemaEntityType"
- $ref: "#/components/parameters/schemaEntityNameQuery"
get:
operationId: list-schemas-for-entity
tags:
- Retrieve Schemas
summary: List for Entity
description: Get all schemas for a specific entity type
responses:
'200':
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ListSchemasResponse'
'401':
$ref: "#/components/schemas/ListSchemasResponse"
"401":
$ref: ./common/responses.yaml#/401Unauthorized
'403':
"403":
$ref: ./common/responses.yaml#/403Forbidden
delete:
operationId: delete-schemas-for-entity
Expand All @@ -125,37 +126,37 @@ paths:
summary: Delete for Entity
description: Delete all schemas of a specific entity type
responses:
'200':
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteSchemasResponse'
'401':
$ref: "#/components/schemas/DeleteSchemasResponse"
"401":
$ref: ./common/responses.yaml#/401Unauthorized
'403':
"403":
$ref: ./common/responses.yaml#/403Forbidden
/projects/{projectId}/schemas/{entityType}/{name}:
parameters:
- $ref: ./common/parameters.yaml#/path/projectId
- $ref: '#/components/parameters/schemaEntityType'
- $ref: '#/components/parameters/schemaEntityName'
- $ref: "#/components/parameters/schemaEntityType"
- $ref: "#/components/parameters/schemaEntityName"
get:
operationId: list-schemas-by-entity-and-name
tags:
- Retrieve Schemas
summary: List for Entity and Name
description: Get the schema for a specific entity type and entity name
responses:
'200':
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/Schema'
'401':
$ref: "#/components/schemas/Schema"
"401":
$ref: ./common/responses.yaml#/401Unauthorized
'403':
"403":
$ref: ./common/responses.yaml#/403Forbidden
delete:
operationId: delete-schema-by-entity-and-name
Expand All @@ -164,15 +165,15 @@ paths:
summary: Delete for Entity and Name
description: Delete schema for an entity type and entity name
responses:
'200':
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteSchemasResponse'
'401':
$ref: "#/components/schemas/DeleteSchemasResponse"
"401":
$ref: ./common/responses.yaml#/401Unauthorized
'403':
"403":
$ref: ./common/responses.yaml#/403Forbidden
post:
operationId: upload-schema-by-entity-and-name
Expand Down Expand Up @@ -294,19 +295,19 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Schema'
$ref: "#/components/schemas/Schema"
responses:
'200':
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/UploadSchemasResponse'
'400':
$ref: "#/components/schemas/UploadSchemasResponse"
"400":
$ref: ./common/responses.yaml#/400BadRequest
'401':
"401":
$ref: ./common/responses.yaml#/401Unauthorized
'403':
"403":
$ref: ./common/responses.yaml#/403Forbidden
components:
securitySchemes:
Expand Down Expand Up @@ -341,7 +342,7 @@ components:
- array
- boolean
- integer
- 'null'
- "null"
- number
- object
- string
Expand All @@ -362,7 +363,7 @@ components:
of the entity name
hidden:
type: boolean
description: 'If true, this property will be hidden in the Mixpanel UI'
description: "If true, this property will be hidden in the Mixpanel UI"
default: false
dropped:
type: boolean
Expand Down Expand Up @@ -398,7 +399,7 @@ components:
type: string
hidden:
type: boolean
description: 'If true, this entity will be hidden in the Mixpanel UI'
description: "If true, this entity will be hidden in the Mixpanel UI"
default: false
dropped:
type: boolean
Expand All @@ -425,12 +426,12 @@ components:
type: object
properties:
entityType:
$ref: '#/components/schemas/SchemaEntityType'
$ref: "#/components/schemas/SchemaEntityType"
name:
type: string
description: 'The entity name (eg: Added To Cart)'
description: "The entity name (eg: Added To Cart)"
schemaJson:
$ref: '#/components/schemas/Schema'
$ref: "#/components/schemas/Schema"
required:
- name
- entityType
Expand All @@ -442,7 +443,7 @@ components:
results:
type: array
items:
$ref: '#/components/schemas/SchemaEntry'
$ref: "#/components/schemas/SchemaEntry"
status:
type: string
enum:
Expand Down Expand Up @@ -489,16 +490,23 @@ components:
in: path
name: entityType
schema:
$ref: '#/components/schemas/SchemaEntityType'
$ref: "#/components/schemas/SchemaEntityType"
required: true
description: 'The entity type (eg: event)'
description: "The entity type (eg: event)"
schemaEntityName:
in: path
name: name
schema:
type: string
required: true
description: 'The entity name (eg: Added To Cart)'
description: "The entity name (eg: Added To Cart)"
schemaEntityNameQuery:
in: query
name: entity_name
schema:
type: string
required: false
description: "The entity name (eg: Added To Cart)"
x-explorer-enabled: true
x-proxy-enabled: true
x-samples-enabled: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
title: "Delete for Entity"
title: "Delete for Entity (and optional Name)"
slug: "delete-schemas-for-entity"
excerpt: "Delete all schemas of a specific entity type"
hidden: false
createdAt: "2020-11-20T21:23:20.200Z"
updatedAt: "2023-09-26T21:06:39.043Z"
---

If you need to delete an entity name that contains "/", you can add it as the query string here.

0 comments on commit 6260a2f

Please sign in to comment.