Skip to content

Not generating all model types #1189

@beeblebrox

Description

@beeblebrox

Hi there, I'm having what looks like a very similar issue not generating all the mode types as fixed in #1177 and discussed in #1168. I'm using version v1.13.4.

Not all the types are being generated for https://github.com/openai/openai-openapi/blob/master/openapi.yaml resulting in compilation errors. Sorry, I don't understand the issue enough to minimize the use case(s) that is failing. I am using oapi-codegen -package api -o openapi.gen.go openapi.yaml to generate the code. I apologize if there is some gotchya I'm not aware of that I missed.

There are many const types being affected:

// Defines values for CreateChatCompletionRequestFunctionCall0.
const (
	Auto CreateChatCompletionRequestFunctionCall0 = "auto"
	None CreateChatCompletionRequestFunctionCall0 = "none"
)

Auto and None are not defined anywhere.
Another interesting path to note is:

const (
	CodeDavinci002 CreateCompletionRequestModel1 = "code-davinci-002"
	TextAda001     CreateCompletionRequestModel1 = "text-ada-001"
	TextBabbage001 CreateCompletionRequestModel1 = "text-babbage-001"
	TextCurie001   CreateCompletionRequestModel1 = "text-curie-001"
	TextDavinci001 CreateCompletionRequestModel1 = "text-davinci-001"
	TextDavinci002 CreateCompletionRequestModel1 = "text-davinci-002"
	TextDavinci003 CreateCompletionRequestModel1 = "text-davinci-003"
)

where CreateCompletionRequestModel1 is defined but is a type alias of a non-defined type:

// CreateCompletionRequestModel1 defines model for .
type CreateCompletionRequestModel1 CreateCompletionRequestModel

I do see the type define under componets:schema. I tried removing some more advanced schema usages like the linked references and aliases on the type but it didn't seem to make a difference.

Unlike the other issue where if the types were in the response, most of these types are used in request bodies. I don't know if that is relevant or not to the issue.

I haven't tried an older version yet, but that's my next step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions