Skip to content

Generation error due to the use of a default value for an enum that contained invalid characters #2091

@darrelmiller

Description

@darrelmiller

Issue with OpenAI OpenAPI https://raw.githubusercontent.com/openai/openai-openapi/master/openapi.yaml

This property in the CreateImageRequest constructor is problematic because of the enum value.

          "size": {
            "enum": [
              "256x256",
              "512x512",
              "1024x1024"
            ],
            "type": "string",
            "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.",
            "default": "1024x1024",
            "nullable": true,
            "example": "1024x1024"
          },

Created this constructor code in the model which fails to compile

image

The enum got generated correctly, but the default value did not get translated

    public enum CreateImageRequest_size {
        TwoFiveSixx256,
        FiveOneTwox512,
        OneZeroTwoFourx1024,
    }

Metadata

Metadata

Assignees

Labels

CsharpPull requests that update .net codetype:bugA broken experience

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions