directus / directus/openapi

Id is not required

Open
#22 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
9
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Collections with `Primary Key` Field set to `Auto-incremented integer` or `Auto-incremented big integer` doesn't have the id property set to required as oppose to collections where the id type is set to `Generated UUID.`
This issue causes clients such as [Orval](https://orval.dev/) to generate types with optional id.

```json
"ItemsUUID": {
"type": "object",
"properties": {
"id": {
"nullable": false,
"type": "string",
"format": "uuid"
},
"name": {
"nullable": true,
"type": "string"
}
},
"x-collection": "uuid",
"required": [
"id"
]
},
"ItemsInteger": {
"type": "object",
"properties": {
"id": {
"nullable": false,
"type": "integer"
},
"name": {
"nullable": true,
"type": "string"
}
},
"x-collection": "integer"
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.