From 271349a0ec00f7459b24daf0de7bd9fa94108a8d Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 3 Mar 2023 18:01:58 +0800 Subject: [PATCH] refactor(nocodb): formula model in swagger.json --- packages/nocodb/src/schema/swagger.json | 71 ++++++++++++------------- 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/packages/nocodb/src/schema/swagger.json b/packages/nocodb/src/schema/swagger.json index ccb7337b31..6db1f93a54 100644 --- a/packages/nocodb/src/schema/swagger.json +++ b/packages/nocodb/src/schema/swagger.json @@ -9245,76 +9245,73 @@ "description": "Model for Formula", "examples": [ { - "deleted": "string", - "fk_column_id": "string", - "formula": "string", - "formula_raw": "string", - "id": "string", - "order": "string", - "type": "string", - "virtual": true + "id": "fm_1lo8wqtvvipdns", + "fk_column_id": "cl_h2micb4jdnmsh1", + "formula": "CONCAT(\"FOO\", {{cl_c5knoi4xs4sfpt}})", + "formula_raw": "CONCAT(\"FOO\", {Title})", + "error": "Error Message shows here" } ], + "title": "Formula Model", + "type": "object", "properties": { - "deleted": { - "type": "string" + "id": { + "$ref": "#/components/schemas/Id", + "description": "Unique ID" }, "fk_column_id": { "$ref": "#/components/schemas/Id", "description": "Foreign Key to Column" }, "formula": { - "type": "string" + "type": "string", + "description": "Formula with column ID replaced", + "example": "CONCAT(\"FOO\", {{cl_c5knoi4xs4sfpt}})" }, "formula_raw": { - "type": "string" - }, - "id": { - "$ref": "#/components/schemas/Id", - "description": "Unique ID" - }, - "order": { - "type": "string" - }, - "type": { - "type": "string" + "type": "string", + "description": "Original Formula inputted in UI", + "example": "CONCAT(\"FOO\", {Title})" }, - "virtual": { - "$ref": "#/components/schemas/Bool" + "error": { + "type": "string", + "description": "Error Message" } - }, - "title": "Formula Model", - "type": "object" + } }, "FormulaColumnReq": { "description": "Model for Formula Column Request", "examples": [ { - "formula": "string", - "formula_raw": "string", - "title": "string", + "formula": "CONCAT(\"FOO\", {{cl_c5knoi4xs4sfpt}})", + "formula_raw": "CONCAT(\"FOO\", {Title})", + "title": "Formula", "uidt": "Formula" } ], + "title": "Formula Column Request Model", + "type": "object", "properties": { "formula": { - "type": "string" + "type": "string", + "description": "Formula with column ID replaced" }, "formula_raw": { - "type": "string" + "type": "string", + "description": "Original Formula inputted in UI" }, "title": { "maxLength": 255, "minLength": 1, - "type": "string" + "type": "string", + "description": "Formula Title" }, "uidt": { "enum": ["Formula"], - "type": "string" + "type": "string", + "description": "UI Data Type" } - }, - "title": "Formula Column Request Model", - "type": "object" + } }, "Gallery": { "description": "Model for Gallery",