GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fail to gen nullable anyof type · Issue #2218 · oapi-codegen/oapi-codegen

fail to gen nullable anyof type #2218

New issue
Copy link
New issue
Copy link
Closed
Closed
fail to gen nullable anyof type#2218
Copy link
Labels
3.1
Milestone
v2.8.0

Description

@caibirdme
caibirdme
opened on Feb 13, 2026
Issue body actions

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]

Activity

  1. mromaszewicz
    added
    3.1
    on Feb 17, 2026
  2. mromaszewicz commented on Feb 17, 2026

    @mromaszewicz
    mromaszewicz
    on Feb 17, 2026
    Member
    More actions

    Type null isn't a valid OpenAPI 3.0 type, this is a 3.1 convention, and our underlying parser doesn't support 3.1 yet.

    I don't yet know how we're going to handle 3.1+ since we are so tied to kin-openapi.

    I have an alternative, experimental (not yet stable) oapi-codegen here: https://github.com/oapi-codegen/oapi-codegen-exp/tree/main/experimental

    I'd be curious if it works for you, however, if you have any problems with it, file jiras in that repo.

  3. mromaszewicz
    added this to the v2.8.0 milestone on May 1, 2026
  4. mromaszewicz commented on Jun 21, 2026

    @mromaszewicz
    mromaszewicz
    on Jun 21, 2026
    Member
    More actions

    This was fixed in #2336 with OpenAPI 3.1 support being added.

  5. mromaszewicz
    closed this as completedon Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.1

    Type

    No type

    Projects

    No projects

      Milestone

      • v2.8.0No due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.