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

Error enum value type handling #3426

Closed
infokomes opened this issue Oct 5, 2023 · 3 comments · Fixed by #3478
Closed

Error enum value type handling #3426

infokomes opened this issue Oct 5, 2023 · 3 comments · Fixed by #3478
Assignees
Labels
Csharp Pull requests that update .net code generator Issues or improvements relater to generation capabilities. type:bug A broken experience WIP
Milestone

Comments

@infokomes
Copy link

Error CS1056 Unexpected character '’'

openapi: 3.0.2

LoremResult:
type: string
enum: [ Lorem, Invalid lorem’s, Unexpected result ]
description: A list of values
example: Lorem

public enum ServiceProvider_LoremResult {
[EnumMember(Value = "Lorem")]
Lorem,
[EnumMember(Value = "Invalid lorem’s")]
InvalidLorem’s,
[EnumMember(Value = "Unexpected result")]
UnexpectedResult,
}

@andrueastman
Copy link
Member

Thanks for raising this @infokomes

Just to confirm what you mean, is that the given the openApi input

openapi: 3.0.2

LoremResult:
type: string
enum: [ Lorem, Invalid lorem’s, Unexpected result ]
description: A list of values
example: Lorem

Generates the C# class

public enum ServiceProvider_LoremResult {
[EnumMember(Value = "Lorem")]
Lorem,
[EnumMember(Value = "Invalid lorem’s")]
InvalidLorem’s,
[EnumMember(Value = "Unexpected result")]
UnexpectedResult,
}

And the issues is that the enum member InvalidLorem’s causes a compile failure?

@baywet baywet added type:bug A broken experience generator Issues or improvements relater to generation capabilities. labels Oct 5, 2023
@baywet baywet added this to the Kiota v1.8 milestone Oct 5, 2023
@baywet
Copy link
Member

baywet commented Oct 5, 2023

@andrueastman FYI infokomes liked your reply as a confirmation (I know we don't get notifications for that).
To me it looks like a bug in the symbols cleanup logic. Queued for the next release. Do you mind taking it?

@andrueastman
Copy link
Member

No worries. Acknowledging this

@baywet baywet added Csharp Pull requests that update .net code and removed Csharp Pull requests that update .net code labels Oct 5, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Kiota Oct 12, 2023
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 generator Issues or improvements relater to generation capabilities. type:bug A broken experience WIP
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants