Oh man, this page has become a mess.
Current status
- The Partial (Lax) Operator solves the “partial types” concept discussed here
- “Field Permissions” - Read-only fields can be accomplished with the
-
operator, if we end up doing that - except for the case where they depend on contexts
- Context is still unsolved though
- This might be useful for manipulating the same data via different APIs
- Or different permissions levels or whatever
- The behavior of
PATCH
es needs to be a part of the resource class. We should extend that to PUT
s as well
- We need subsettable resource class types that work with codegen for properties that are hidden under some contexts, not editable in others, etc
- It would be nice to programmatically infer if something is read-only or editable and display that appropriately on the client side
- I’ve always wanted a sum type for this tbh
- Sometimes the user might not even want to disclose that the field exists for non-privileged users… maybe that just needs to be its own thing
Field permissions
How do we standardize client reading schema? including editablity for PATCH and stuff
or do we not? sometimes depends on context
Maybe this needs to be a sum type - read only, editable, etc
❓
- Do we define permissions inline or separately?
🤔
- While having all of the fields in one place and relying on context to determine permissions makes for good codegen, users may not want to expose all of their fields all the time. Not even as a security mechanism but as a matter of principle. But then the user should just be able to define types separately as they see fit