Comments (1)
Further observations related to this issue, i.e. how peculiarly NocoDB handles a base's meta
field:
-
A call to the
PATCH /api/v2/meta/bases/{base_id}
API endpoint to update a base incl. themeta
field succeeds1 iffmeta
is specified as a character scalar instead of an actual JSON object, andmeta.iconColor
is included.
Working example:
curl -X 'PATCH' \ 'https://api.example.com/api/v2/meta/bases/{baseId}' \ -H 'xc-token: abcd1234' \ -H 'Content-Type: application/json' \ -d '{ "meta": "{\"iconColor\":\"#3f4eff\",\"showNullAndEmptyInFilter\":true}" }'
-
The
POST /api/v2/meta/bases
API endpoint to create a new base OTOH acceptsmeta
as a regular JSON object and the result is properly interpreted by the server AFAICT.After creating a new base this way, the
GET /api/v2/meta/bases/{base_id}
API endpoint to retrieve an existing base returns themeta
field as a JSON object (like the rest of the JSON body).This is what one would expect.
-
When config encoded in the
meta
field is changed via the NocoDB UI, NocoDB seems to store the updatedmeta
config as a character scalar instead of a JSON object. This can be verified by first creating a new base as outlined above, then changing e.g. the base's icon color and finally calling theGET /api/v2/meta/bases/{base_id}
endpoint – themeta
field in the response body is now a character scalar (containing valid JSON syntax) instead of an actual JSON object.On page reload, NocoDB seems to attempt to parse a base's
meta
field (and throws aJSON.parse
error if that fails for some reason).
Why is handling the meta
field implemented in this way (writing and parsing JSON text instead of directly using actual JSON)? Besides making it hard to use NocoDB's RESTful API, this also unnecessarily complicates development, I think.
Footnotes
-
Meaning the result is properly parsed by the server. ↩
from nocodb.
Related Issues (20)
- 🐛 Bug: Meta API docs need fix when working with ws/base
- 🐛 Bug: field sorting will send two requests in weak network HOT 1
- 🐛 Bug: Table connected to external MySQL showing "The field you are trying to access does not exist." after grouping by a column.
- 🐛 Bug: External data source options not available in 0.207 HOT 2
- 🔦 Feature: UI add pagination to the lists HOT 2
- 🐛 Bug: Input of lookup field doesn't update with barcode scanner HOT 2
- 🐛 Bug: Failed to load list: Something went wrong HOT 1
- 🐛 Bug: count api sometimes returns 0 HOT 3
- 🐛 Bug: "connect a data source" is missing on 0.207.3(nocodb binary version) HOT 2
- 🐛 Bug: Function to Show/Hide M2M Junction tables has no effect HOT 2
- 🐛 Bug: Cell drag is not resulting in audit entries
- How to use/any experiences on SQLAlchemy Automap on NocoDB? / or how to disable Many-to-many relation separated table feature in NocoDB? HOT 1
- 🐛 Bug: Mobile iOS safari - add new record not visible HOT 2
- Bug : Form submission leads to an error when submitting the shared form if the column name has a '.' (dot) character.
- 🔦 Feature: Auto infer non-English column name when import data to existing table.(If exists this column name)
- 🔦 Feature: The color of scrollbar need to be more obvious.
- 🔦 Feature: Support changing `Show M2M Tables` and `Show NULL in Cells` base settings via RESTful API
- 🐛 Bug: Webhook delete payload is only visible columns HOT 1
- 🐛 Bug: After creating the project, the entry to create the data source cannot be found HOT 1
- 🐛 Bug: Escaping of '&' character prevents using URL field as clickable GET form which passes multiple parameters
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nocodb.