Skip to content

Conversation

@Turbo87
Copy link
Contributor

@Turbo87 Turbo87 commented Dec 16, 2025

This pull request adds support for handling wildcard HTTP status codes (like '2XX', '4XX', etc.) in the fetch client code generator. The changes ensure that wildcard status codes in OpenAPI specifications are correctly mapped to TypeScript types, and updates are made to both the code generation logic and the test suite to verify this behavior.

This should resolve #950

Copilot AI review requested due to automatic review settings December 16, 2025 15:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for wildcard HTTP status codes (e.g., 2XX, 4XX, 5XX) in OpenAPI specifications, enabling the fetch client generator to correctly map these wildcard patterns to TypeScript types like HTTPStatusCode2xx, HTTPStatusCode4xx, etc.

  • Implements regex-based detection and transformation of wildcard status codes to TypeScript type names
  • Updates header generation logic to include HTTP status code types when wildcard codes are used
  • Adds comprehensive test specification covering various wildcard and mixed response scenarios

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/specifications/wildcard-responses.yaml New OpenAPI spec with test cases for wildcard responses (2XX, 3XX, 4XX, 5XX) and mixed specific/wildcard scenarios
tests/configs/fetch.config.ts Configuration entry to generate code from the new wildcard responses specification
packages/fetch/src/index.ts Core implementation: regex validation, status code type mapping, and enhanced header generation detection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@melloware melloware added the fetch Fetch client related issue label Dec 17, 2025
@melloware melloware merged commit abf2726 into orval-labs:master Dec 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fetch Fetch client related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for wildcard HTTP responses

2 participants