OpenAPITools / OpenAPITools/openapi-generator

[REQ] [typescript-fetch] Add unit test for required nullable datetimes

Open
#21,840 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

New test for required nullable datetimes

A bug was recently introduced where required nullable datetimes would cause an issue (runtime crash) for clients when generating the code.

Describe the solution you'd like

A new test could be created that could catch this in the future if any other changes are made to the template.

Additional context

OpenAPI Specification:

{
  "type": "object",
  "properties": {
    "startedAt": {
      "type": "string",
      "format": "date-time",
      "nullable": true
    }
  },
  "required": [
    "startedAt"
  ]

See issue #21820

Contributor guide

Open the contributing guide

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.

Research direction

Start by locating the existing typescript-fetch generator tests and the template or test entry point for generated clients. Use the provided OpenAPI schema with a required nullable date-time property, and consider the work done when generation and the generated client complete without the runtime crash described in issue #21820.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
Half a day
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.