Skip to content

fail to gen nullable anyof type #2218

@caibirdme

Description

@caibirdme

below is part of openai platform api

    ChatCompletionRequestAssistantMessage:
      type: object
      title: Assistant message
      description: |
        Messages sent by the model in response to user messages.
      properties:
        content:
          anyOf:
            - oneOf:
                - type: string
                  description: The contents of the assistant message.
                  title: Text content
                - type: array
                  description: An array of content parts with a defined type. Can be one or more of type `text`, or exactly one of type `refusal`.
                  title: Array of content parts
                  items:
                    $ref: "#/components/schemas/ChatCompletionRequestAssistantMessageContentPart"
                  minItems: 1
              description: >
                The contents of the assistant message. Required unless
                `tool_calls` or `function_call` is specified.
            - type: "null"

And here's the error message:

failed to generate Go types: error generating type definitions: error generating Go types for component schemas: error converting Schema ChatCompletionRequestAssistantMessage to Go type: error generating Go schema for property 'audio': error generating type for anyOf: error resolving primitive type: unhandled Schema type: &[null]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions