Skip to content

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

not defined meta property will cause schema error

Fendy Heryantoe5644dcf9e83
diff --git a/packages/nocodb/src/schema/swagger-v3.json b/packages/nocodb/src/schema/swagger-v3.json
index 3f6152a3cb..687ac612e7 100644
--- a/packages/nocodb/src/schema/swagger-v3.json
+++ b/packages/nocodb/src/schema/swagger-v3.json
@@ -786,7 +786,7 @@
"type": "Number",
"default_value": "34",
"options": {
- "locale_string": true
+ "thousand_separator": true
}
},
{
@@ -998,7 +998,7 @@
"type": "Number",
"default_value": "34",
"options": {
- "locale_string": true
+ "thousand_separator": true
}
},
{
@@ -1288,7 +1288,7 @@
"type": "Number",
"default_value": "34",
"options": {
- "locale_string": true
+ "thousand_separator": true
}
},
{
@@ -5685,7 +5685,7 @@
"FieldOptions_Number": {
"type": "object",
"properties": {
- "locale_string": {
+ "thousand_separator": {
"type": "boolean",
"description": "Show thousand separator on the UI."
}
diff --git a/packages/nocodb/tests/unit/rest/tests/metaApiV3/table.test.ts b/packages/nocodb/tests/unit/rest/tests/metaApiV3/table.test.ts
index 3c4821933c..fb957d9b24 100644
--- a/packages/nocodb/tests/unit/rest/tests/metaApiV3/table.test.ts
+++ b/packages/nocodb/tests/unit/rest/tests/metaApiV3/table.test.ts
@@ -109,6 +109,31 @@ export default function () {
expect(checkboxField.default_value).to.satisfy((val) => val === 'true' || val === '1' || val === 1);
});
+
+ it(`will create number column with incorrect options`, async () => {
+ const table = {
+ title: 'Table Number',
+ description: 'Description',
+ fields: [
+ {
+ title: 'Number',
+ type: 'Number',
+ options: {
+ locale_string: true,
+ },
+ },
+ ],
+ };
+
+ const response = await request(context.app)
+ .post(`${API_PREFIX}/tables`)
+ .set('xc-auth', context.token)
+ .send(table)
+ .expect(400);
+ // console.log('response', JSON.stringify(response.body.details, null, 2))
+
+ expect(response.body.error).to.eq('INVALID_REQUEST_BODY');
+ });
});
});
}