Currently, if in a oneOf schema there's a mix of primitive types and objects only the primitive types are generated.
Example:
function_call:
title: ChatCompletionFunctionCall
description: Controls how the model calls functions.
oneOf:
- type: string
title: ChatCompletionFunctionCallMode
enum: [none, auto]
- $ref: "#/components/schemas/ChatCompletionFunctionCallOption"
ChatCompletionFunctionCallOption:
type: object
properties:
name:
type: string
description: The name of the function to call.
required:
- name
The generator generates the following class:
@freezed
sealed class ChatCompletionFunctionCall with _$ChatCompletionFunctionCall {
const ChatCompletionFunctionCall._();
const factory ChatCompletionFunctionCall.enumeration(
ChatCompletionFunctionCallMode value,
) = _UnionChatCompletionFunctionCallEnum;
/// Object construction from a JSON representation
factory ChatCompletionFunctionCall.fromJson(Map<String, dynamic> json) =>
_$ChatCompletionFunctionCallFromJson(json);
}
Which only contains the ChatCompletionFunctionCall.enumeration factory.
Currently, if in a
oneOf
schema there's a mix of primitive types and objects only the primitive types are generated.Example:
The generator generates the following class:
Which only contains the
ChatCompletionFunctionCall.enumeration
factory.