Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Id is not required

Open
#22 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
openapi
Domain
api

Research direction

Compare the documented schemas for collections using auto-incremented integer or big-integer primary keys with the Generated UUID example in the issue. Trace where the OpenAPI schema marks properties as required, and consider the work done when integer-based collection schemas include id in their required list without changing unrelated properties.

Written by the indexing model from the issue text.

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 to generate types with optional id.

"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"
      }
    }
Dominant language
TypeScript
Stars
9
Forks
8
PR merge metrics
No merged PRs in 30d

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from directus/openapi

All issues in directus/openapi

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.