Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix swagger paths for views

Fendy Heryantoefe91fd92b1e
diff --git a/packages/nocodb-sdk-v2/src/lib/Api.ts b/packages/nocodb-sdk-v2/src/lib/Api.ts
index 18ad931125..4cc19efe26 100644
--- a/packages/nocodb-sdk-v2/src/lib/Api.ts
+++ b/packages/nocodb-sdk-v2/src/lib/Api.ts
@@ -357,7 +357,7 @@ export interface ViewBase {
/** Title of the view. */
title?: string;
/** Lock type of the view. */
- lock_type?: 'collabarative' | 'locked' | 'personal';
+ lock_type?: 'collaborative' | 'locked' | 'personal';
/** Description of the view. */
description?: string;
meta?: {
@@ -1949,6 +1949,29 @@ export class InternalApi<
...params,
}),
+ /**
+ * @description Create a view for table.
+ *
+ * @tags Views
+ * @name ViewCreate
+ * @summary Create view
+ * @request POST:/api/v3/meta/bases/{baseId}/tables/{tableId}/views
+ */
+ viewCreate: (
+ baseId: string,
+ tableId: string,
+ data: ViewCreate,
+ params: RequestParams = {},
+ ) =>
+ this.request<View, void>({
+ path: `/api/v3/meta/bases/${baseId}/tables/${tableId}/views`,
+ method: 'POST',
+ body: data,
+ type: ContentType.Json,
+ format: 'json',
+ ...params,
+ }),
+
/**
* @description Create a new field within the specified table.
*
@@ -2030,6 +2053,60 @@ export class InternalApi<
...params,
}),
+ /**
+ * @description Retrieve the details of a specific view.
+ *
+ * @tags Views
+ * @name ViewRead
+ * @summary Get view schema
+ * @request GET:/api/v3/meta/bases/{baseId}/views/{viewId}
+ */
+ viewRead: (viewId: string, baseId: string, params: RequestParams = {}) =>
+ this.request<View, void>({
+ path: `/api/v3/meta/bases/${baseId}/views/${viewId}`,
+ method: 'GET',
+ format: 'json',
+ ...params,
+ }),
+
+ /**
+ * @description Update the details of a specific view.
+ *
+ * @tags Views
+ * @name ViewUpdate
+ * @summary Update view
+ * @request PATCH:/api/v3/meta/bases/{baseId}/views/{viewId}
+ */
+ viewUpdate: (
+ viewId: string,
+ baseId: string,
+ data: ViewUpdate,
+ params: RequestParams = {},
+ ) =>
+ this.request<View, void>({
+ path: `/api/v3/meta/bases/${baseId}/views/${viewId}`,
+ method: 'PATCH',
+ body: data,
+ type: ContentType.Json,
+ format: 'json',
+ ...params,
+ }),
+
+ /**
+ * @description Delete a specific view.
+ *
+ * @tags Views
+ * @name ViewDelete
+ * @summary Delete view
+ * @request DELETE:/api/v3/meta/bases/{baseId}/views/{viewId}
+ */
+ viewDelete: (viewId: string, baseId: string, params: RequestParams = {}) =>
+ this.request<void, void>({
+ path: `/api/v3/meta/bases/${baseId}/views/${viewId}`,
+ method: 'DELETE',
+ ...params,
+ }),
+
/**
* @description Retrieve a list of all filters and groups for a specific view.
*
diff --git a/packages/nocodb/src/schema/swagger-v3.json b/packages/nocodb/src/schema/swagger-v3.json
index 4ec267f585..00508ab45e 100644
--- a/packages/nocodb/src/schema/swagger-v3.json
+++ b/packages/nocodb/src/schema/swagger-v3.json
@@ -1669,6 +1669,127 @@
"description": "Server error."
}
}
+ },
+ "post": {
+ "summary": "Create view",
+ "description": "Create a view for table.",
+ "operationId": "view-create",
+ "tags": [
+ "Views"
+ ],
+ "parameters": [
+ {
+ "name": "baseId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Unique identifier for the base."
+ },
+ {
+ "name": "tableId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Unique identifier for the table."
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ViewCreate"
+ },
+ "examples": {
+ "Example 1": {
+ "value": {
+ "title": "Created View Title",
+ "type": "grid"
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "View meta updated.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/View"
+ },
+ "examples": {
+ "Example 1": {
+ "value": {
+ "id": "vw5rakj00x28vdht",
+ "title": "myFilterView2",
+ "type": "grid",
+ "lock_type": "collaborative",
+ "created_at": "2025-08-13 07:36:03+00:00",
+ "updated_at": "2025-08-13 07:36:03+00:00",
+ "created_by": "uspf4n7qlp704qrj",
+ "fields": [
+ {
+ "field_id": "csd3tnc2t8ccbw2",
+ "show": true
+ },
+ {
+ "field_id": "cwy23c7tglso0zp",
+ "show": true
+ },
+ {
+ "field_id": "clljtnye0his0wv",
+ "show": true
+ },
+ {
+ "field_id": "cmbwwvp0mhyw6uv",
+ "show": true
+ },
+ {
+ "field_id": "c1kzoujfb6on9ba",
+ "show": true
+ },
+ {
+ "field_id": "c711uewjhfevrjj",
+ "show": true
+ },
+ {
+ "field_id": "cjgsfkb3307h4gj",
+ "show": true
+ },
+ {
+ "field_id": "ck6lswg0z3h6ase",
+ "show": true
+ },
+ {
+ "field_id": "cxlnws1ojnocsr3",
+ "show": true
+ }
+ ],
+ "options": {
+ "row_height": "short"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid request body."
+ },
+ "404": {
+ "description": "Table not found."
+ },
+ "500": {
+ "description": "Server error."
+ }
+ }
}
},
"/api/v3/meta/bases/{baseId}/tables/{tableId}/fields": {
@@ -1958,6 +2079,259 @@
}
}
},
+
+ "/api/v3/meta/bases/{baseId}/views/{viewId}": {
+ "get": {
+ "summary": "Get view schema",
+ "description": "Retrieve the details of a specific view.",
+ "operationId": "view-read",
+ "tags": [
+ "Views"
+ ],
+ "parameters": [
+ {
+ "name": "viewId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Unique identifier for the view."
+ },
+ {
+ "name": "baseId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Unique identifier for the base."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "View details are retrieved.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/View"
+ },
+ "examples": {
+ "Example 1": {
+ "value": {
+ "id": "vw5rakj00x28vdht",
+ "title": "myFilterView2",
+ "type": "grid",
+ "lock_type": "collaborative",
+ "created_at": "2025-08-13 07:36:03+00:00",
+ "updated_at": "2025-08-13 07:36:03+00:00",
+ "created_by": "uspf4n7qlp704qrj",
+ "fields": [
+ {
+ "field_id": "csd3tnc2t8ccbw2",
+ "show": true
+ },
+ {
+ "field_id": "cwy23c7tglso0zp",
+ "show": true
+ },
+ {
+ "field_id": "clljtnye0his0wv",
+ "show": true
+ },
+ {
+ "field_id": "cmbwwvp0mhyw6uv",
+ "show": true
+ },
+ {
+ "field_id": "c1kzoujfb6on9ba",
+ "show": true
+ },
+ {
+ "field_id": "c711uewjhfevrjj",
+ "show": true
+ },
+ {
+ "field_id": "cjgsfkb3307h4gj",
+ "show": true
+ },
+ {
+ "field_id": "ck6lswg0z3h6ase",
+ "show": true
+ },
+ {
+ "field_id": "cxlnws1ojnocsr3",
+ "show": true
+ }
+ ],
+ "options": {
+ "row_height": "short"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "View not found."
+ },
+ "500": {
+ "description": "Server error."
+ }
+ }
+ },
+ "patch": {
+ "summary": "Update view",
+ "description": "Update the details of a specific view.",
+ "operationId": "view-update",
+ "tags": [
+ "Views"
+ ],
+ "parameters": [
+ {
+ "name": "viewId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Unique identifier for the view."
+ },
+ {
+ "name": "baseId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Unique identifier for the base."
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ViewUpdate"
+ },
+ "examples": {
+ "Example 1": {
+ "value": {
+ "title": "Updated View Title"
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "View meta updated.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/View"
+ },
+ "examples": {
+ "Example 1": {
+ "value": {
+ "id": "vw5rakj00x28vdht",
+ "title": "myFilterView2",
+ "type": "grid",
+ "lock_type": "collaborative",
+ "created_at": "2025-08-13 07:36:03+00:00",
+ "updated_at": "2025-08-13 07:36:03+00:00",
+ "created_by": "uspf4n7qlp704qrj",
+ "fields": [
+ {
+ "field_id": "csd3tnc2t8ccbw2",
+ "show": true
+ },
+ {
+ "field_id": "cwy23c7tglso0zp",
+ "show": true
+ },
+ {
+ "field_id": "clljtnye0his0wv",
+ "show": true
+ },
+ {
+ "field_id": "cmbwwvp0mhyw6uv",
+ "show": true
+ },
+ {
+ "field_id": "c1kzoujfb6on9ba",
+ "show": true
+ },
+ {
+ "field_id": "c711uewjhfevrjj",
+ "show": true
+ },
+ {
+ "field_id": "cjgsfkb3307h4gj",
+ "show": true
+ },
+ {
+ "field_id": "ck6lswg0z3h6ase",
+ "show": true
+ },
+ {
+ "field_id": "cxlnws1ojnocsr3",
+ "show": true
+ }
+ ],
+ "options": {
+ "row_height": "short"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid request body."
+ },
+ "404": {
+ "description": "Table not found."
+ },
+ "500": {
+ "description": "Server error."
+ }
+ }
+ },
+ "delete": {
+ "summary": "Delete view",
+ "description": "Delete a specific view.",
+ "operationId": "view-delete",
+ "tags": [
+ "Views"
+ ],
+ "parameters": [
+ {
+ "name": "viewId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Unique identifier for the view."
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "View deleted successfully."
+ },
+ "404": {
+ "description": "View not found."
+ },
+ "500": {
+ "description": "Server error."
+ }
+ }
+ }
+ },
"/api/v3/meta/bases/{baseId}/views/{viewId}/filters": {
"get": {
"summary": "List view filters",