Skip to content

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

swagger: view create (wip)

Raju Udava00b77a115138
diff --git a/packages/nocodb/src/schema/swagger-v3.json b/packages/nocodb/src/schema/swagger-v3.json
index 16ac977db1..355803f8f5 100644
--- a/packages/nocodb/src/schema/swagger-v3.json
+++ b/packages/nocodb/src/schema/swagger-v3.json
@@ -5701,30 +5701,34 @@
"type": "string",
"description": "Title of the view."
},
+ "type": {
+ "type": "string",
+ "enum": [
+ "grid",
+ "gallery",
+ "kanban",
+ "calendar"
+ ],
+ "description": "Type of the view. \n\nNote: Creation of form view using API is not supported currently"
+ },
"lock_type": {
"type": "string",
"enum": [
"collaborative",
- "locked",
- "personal"
+ "locked"
],
- "description": "Lock type of the view."
+ "description": "Lock type of the view.\n\n Note: Assigning view as personal using API is not supported currently",
+ "default": "collaborative"
},
"description": {
"type": "string",
"description": "Description of the view."
- },
- "sorts": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/SortCreate"
- },
- "description": "Sort options for the view."
- },
- "row_coloring": {
- "$ref": "#/components/schemas/ViewRowColorCreate"
}
- }
+ },
+ "required": [
+ "title",
+ "type"
+ ]
},
"ViewOptionBase": {
"type": "object",
@@ -5874,60 +5878,6 @@
}
]
},
- "ViewCreate": {
- "type": "object",
- "allOf": [
- {
- "$ref": "#/components/schemas/ViewBase"
- },
- {
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "grid",
- "gallery",
- "kanban",
- "calendar",
- "form"
- ],
- "description": "Type of the view."
- },
- "fields": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "field_id": {
- "type": "string"
- },
- "show": {
- "type": "boolean"
- },
- "width": {
- "type": "integer"
- },
- "aggregation": {
- "$ref": "#/components/schemas/ViewAggregationEnum"
- }
- },
- "required": [
- "field_id",
- "show"
- ]
- }
- }
- },
- "required": [
- "type",
- "title"
- ]
- },
- {
- "$ref": "#/components/schemas/ViewBaseOptions"
- }
- ]
- },
"ViewUpdate": {
"type": "object",
"allOf": [
@@ -5967,6 +5917,7 @@
}
]
},
+
"ViewList": {
"type": "object",
"properties": {
@@ -6051,96 +6002,88 @@
"list"
]
},
- "View": {
+ "ViewCreate": {
"type": "object",
"allOf": [
{
"$ref": "#/components/schemas/ViewBase"
},
{
- "properties": {
- "id": {
- "type": "string",
- "format": "uuid",
- "description": "Unique identifier for the view."
- },
- "type": {
- "type": "string",
- "enum": [
- "grid",
- "gallery",
- "kanban",
- "calendar",
- "form"
- ],
- "description": "Type of the view."
- },
- "is_default": {
- "type": "boolean",
- "description": "Indicates if this is the default view."
- },
- "created_by": {
- "type": "string",
- "format": "uuid",
- "description": "User ID of the creator."
+ "oneOf": [
+ {
+ "type": "object",
+ "title": "grid",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "grid"
+ ]
+ },
+ "options": {
+ "$ref": "#/components/schemas/ViewOptionsGrid"
+ }
+ }
},
- "owned_by": {
- "type": "string",
- "format": "uuid",
- "description": "User ID of the owner."
+ {
+ "type": "object",
+ "title": "gallery",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "gallery"
+ ]
+ },
+ "options": {
+ "$ref": "#/components/schemas/ViewOptionsGallery"
+ }
+ }
},
- "created_at": {
- "type": "string",
- "format": "date-time",
- "description": "Timestamp of creation."
+ {
+ "type": "object",
+ "title": "kanban",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "kanban"
+ ]
+ },
+ "options": {
+ "$ref": "#/components/schemas/ViewOptionsKanban"
+ }
+ },
+ "required": [
+ "options"
+ ]
},
- "updated_at": {
- "type": "string",
- "format": "date-time",
- "description": "Timestamp of last update."
+ {
+ "type": "object",
+ "title": "calendar",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "calendar"
+ ]
+ },
+ "options": {
+ "$ref": "#/components/schemas/ViewOptionsCalendar"
+ }
+ },
+ "required": [
+ "options"
+ ]
+
}
+ ],
+ "discriminator": {
+ "propertyName": "type"
}
- },
- {
- "$ref": "#/components/schemas/ViewBaseOptions"
}
]
},
- "ViewOptionsGrid": {
- "type": "object",
- "properties": {
- "groups": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "field_id": {
- "type": "string"
- },
- "direction": {
- "type": "string",
- "enum": [
- "asc",
- "desc"
- ]
- },
- "row_height": {
- "type": "string",
- "enum": [
- "short",
- "medium",
- "tall",
- "extra"
- ]
- }
- },
- "required": [
- "field_id"
- ]
- }
- }
- }
- },
"ViewOptionsKanban": {
"type": "object",
"properties": {
@@ -6148,10 +6091,13 @@
"type": "object",
"properties": {
"field_id": {
- "type": "string"
+ "type": "string",
+ "format": "uuid",
+ "description": "Single select field ID to be used for stacking cards in kanban view."
},
"stack_order": {
"type": "array",
+ "description": "Order of the stacks in kanban view. If not provided, the order will be determined by options listed in associated field.\n\nExample: ```stack_order: ['option1', 'option2', 'option3']```",
"items": {
"type": "string"
}
@@ -6160,7 +6106,9 @@
"required": ["field_id"]
},
"cover_field_id": {
- "type": "string"
+ "type": "string",
+ "format": "uuid",
+ "description": "Attachment field ID to be used as cover image in kanban view. If not provided, cover field configuration is skipped."
}
},
"required": [
@@ -6176,10 +6124,12 @@
"type": "object",
"properties": {
"start_date_field_id": {
- "type": "string"
+ "type": "uuid",
+ "description": "Date field ID to be used as start date in calendar view."
},
"end_date_field_id": {
- "type": "string"
+ "type": "uuid",
+ "description": "Date field ID to be used as end date in calendar view."
}
},
"required": [
@@ -6196,7 +6146,9 @@
"type": "object",
"properties": {
"cover_field_id": {
- "type": "string"
+ "type": "string",
+ "format": "uuid",
+ "description": "Attachment field ID to be used as cover image in gallery view. Is optional, if not provided, the first attachment field will be used."
}
}
},
@@ -6257,6 +6209,7 @@
}
}
},
+
"ViewRowColorCreate": {
"type": "object",
"properties": {
@@ -6295,6 +6248,103 @@
"mode"
]
},
+ "View": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ViewBase"
+ },
+ {
+ "properties": {
+ "id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Unique identifier for the view."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "grid",
+ "gallery",
+ "kanban",
+ "calendar",
+ "form"
+ ],
+ "description": "Type of the view."
+ },
+ "is_default": {
+ "type": "boolean",
+ "description": "Indicates if this is the default view."
+ },
+ "created_by": {
+ "type": "string",
+ "format": "uuid",
+ "description": "User ID of the creator."
+ },
+ "owned_by": {
+ "type": "string",
+ "format": "uuid",
+ "description": "User ID of the owner."
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Timestamp of creation."
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Timestamp of last update."
+ }
+ }
+ },
+ {
+ "$ref": "#/components/schemas/ViewBaseOptions"
+ }
+ ]
+ },
+ "ViewOptionsGrid": {
+ "type": "object",
+ "properties": {
+ "groups": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "field_id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Identifier for the field being sorted."
+ },
+ "direction": {
+ "type": "string",
+ "enum": [
+ "asc",
+ "desc"
+ ],
+ "description": "Direction of the group, either 'asc' (ascending) or 'desc' (descending).",
+ "default": "asc"
+ }
+ },
+ "required": [
+ "field_id"
+ ]
+ },
+ "description": "List of groups to be applied on the grid view."
+ },
+ "row_height": {
+ "type": "string",
+ "enum": [
+ "short",
+ "medium",
+ "tall",
+ "extra"
+ ],
+ "description": "Height of the rows in the grid view.",
+ "default": "short"
+ }
+ }
+ },
"FieldBase": {
"type": "object",
"properties": {