-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
It seems that requests when using the createCollection method is incorrectly routing requests. Instead of sending to:
- Expected: POST /v1/collections (for CreateCollectionRequest)
- Actual: POST /v1/data/owned (for CreateOwnedDataRequest)
I am following the correct structure using CreateCollectionRequest DTO
2. Error path proves misdirection - data[0].owner/schema comes from CreateOwnedDataRequest validation
3. API endpoints are different - collections vs data endpoints serve different purposes
The API receives the collection request at the data endpoint and tries to validate it as:
CreateOwnedDataRequest {
owner: Did, // ← Expected at data[0].owner
collection: z.uuid(),
data: z.array(z.record(...)), // ← Our collection object ends up here
acl: AclDto
}
But the collection object has:
CreateCollectionRequest {
_id: z.uuid(), // ← Gets put in data[0]
type: "owned", // ← Causes owner validation to fail
name: string,
schema: {...} // ← Causes schema validation to fail (expects record)
}
Metadata
Metadata
Assignees
Labels
No labels