Comments (5)
As a followup thought, it would be interesting to see how this could apply to the generated TS library. Could the specification of fields also omit object properties from the returned result type of queries?
from chiselstrike.
Just to clarify, you are talking about CRUD API, aren't you?
from chiselstrike.
Yes, just the generated API and not for other routes in general.
from chiselstrike.
Ok. In that case, it sounds fairly easy to do.
One thing though, why do you want the ID to be always present if user doesn't specify it? I know it's sort of a special field, but if user doesn't want it, why send it?
from chiselstrike.
I'd consider it a best practice to always send the ID. After all, a set of results that's completely void of properties would be confusing (even if that's what they asked for) and impossible to know how to compose more URLs to get the full data for individual items if desired.
As a specific example, let's take PUT, which generates an ID. If the developer wishes to not get reflected back to them all the properties that they just specified, they would at least need the ID to get a hold of it later. Not sending it might be a confusing mistake.
from chiselstrike.
Related Issues (20)
- Feature: More graceful handling of policy code that canβt be optimized
- Making policy function async causes chiseld to crash without recovery
- Support use of === operator in policy code
- Support debug logging in policy code
- Policy API should allow normal representation of HTTP headers during access
- Build requires native OpenSSL
- give meaningful error message when model contains duplicate fields
- CRUD responses in HATEOAS format HOT 1
- ERR! code ENOSPC HOT 4
- ChiselStrike is breaking on WSL2 HOT 1
- Possible to support EdgeDB? HOT 4
- Doesn't run from example HOT 4
- Wider support for JWT authentication HOT 1
- Support WebSocket endpoints HOT 1
- Proposal: nanoid instead of uuid
- Relationships: create a blogpost referencing existing author? HOT 2
- Build into desktop app
- Support working with pnpm
- events persistence: not-consumed are lost after restart HOT 1
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 chiselstrike.