Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
darrelmiller opened this issue Dec 19, 2022 · 2 comments · Fixed by #2118
Assignees
Labels
Csharp Pull requests that update .net code type:bug A broken experience
Milestone

Comments

@darrelmiller
Copy link
Member

darrelmiller commented Dec 19, 2022

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,
    }
@darrelmiller darrelmiller added the generator Issues or improvements relater to generation capabilities. label Dec 19, 2022
@darrelmiller darrelmiller changed the title Generation error Generation error due to the use of a default value for an enum that contained invalid characters Dec 19, 2022
@baywet baywet added type:bug A broken experience Csharp Pull requests that update .net code labels Dec 19, 2022
@baywet baywet added this to the Kiota GA milestone Dec 19, 2022
@baywet baywet removed the generator Issues or improvements relater to generation capabilities. label Dec 19, 2022
@andrueastman
Copy link
Member

Had to omit a couple of paths when testing out with the OpenAPI at https://raw.githubusercontent.com/openai/openai-openapi/master/openapi.yaml because Kiota complains due to an empty items schema as below.

image

Any chance this was the same for you on testing @darrelmiller? And out of curiosity is this invalid description?
cc @baywet

@andrueastman
Copy link
Member

Had to omit a couple of paths when testing out with the OpenAPI at https://raw.githubusercontent.com/openai/openai-openapi/master/openapi.yaml because Kiota complains due to an empty items schema as below.

image

Any chance this was the same for you on testing @darrelmiller? And out of curiosity is this invalid description? cc @baywet

Just realized this is followed up with #2089 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Csharp Pull requests that update .net code type:bug A broken experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants