Skip to content

Conversation

@samchon
Copy link
Owner

@samchon samchon commented Jul 4, 2025

This pull request introduces enhancements to several parts of the codebase, including version updates, improved error handling, and support for discriminators in schemas. The most notable changes are the introduction of detailed HTTP error handling, updates to schema composition for ChatGPT, and the addition of discriminator support in the IChatGptSchema structure.

Version Update:

  • package.json: Updated the package version from 4.3.3 to 4.4.0-dev.20250704. This likely indicates a development version with new features or improvements.

HTTP Error Handling Enhancements:

  • src/http/HttpError.ts: Enhanced the HttpError class to include detailed HTTP-specific information such as method, path, status code, and headers. Added comprehensive documentation for constructors and methods, and improved serialization via the toJSON method for structured error data. [1] [2] [3]

Schema Composition Updates:

Discriminator Support in Schema Structures:

  • src/structures/IChatGptSchema.ts: Introduced the x-discriminator field and its associated namespace IAnyOf.IDiscriminator to provide detailed information about union type discriminators, including property names and mappings.

@samchon samchon requested a review from Copilot July 4, 2025 01:19
@samchon samchon self-assigned this Jul 4, 2025
@samchon samchon added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 4, 2025
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 PR adds discriminator support to schema definitions, enhances HTTP error handling with richer metadata and serialization, and bumps the package version to a new development iteration.

  • Introduce x-discriminator in IChatGptSchema.IAnyOf for union type discriminators
  • Extend HttpError to capture method, path, status, headers, and provide structured JSON output
  • Update schema composer to propagate discriminators when composing oneOf types
  • Bump version to 4.4.0-dev.20250704 in package.json

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/structures/IChatGptSchema.ts Added optional x-discriminator field and IDiscriminator interface
src/http/HttpError.ts Enhanced HttpError with HTTP metadata, docs, and JSON serialization
src/composers/llm/ChatGptSchemaComposer.ts Added logic to include x-discriminator when composing oneOf schemas
package.json Updated version from 4.3.3 to 4.4.0-dev.20250704
Comments suppressed due to low confidence (1)

src/structures/IChatGptSchema.ts:267

  • The JSDoc references IAnyOf.oneof, but the interface uses anyOf. Update the link to @link IAnyOf.anyOf or correct the description to match the property name.
       * {@link IAnyOf.oneof} elements. Therefore, `key` of `mapping` is the

@samchon samchon merged commit a105a93 into master Jul 4, 2025
4 checks passed
@samchon samchon deleted the feat/x-oneOf branch July 4, 2025 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants