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

Generated enum parsing methods should return nil in the default case. #4621

Closed
andrueastman opened this issue May 8, 2024 · 0 comments · Fixed by #4646
Closed

Generated enum parsing methods should return nil in the default case. #4621

andrueastman opened this issue May 8, 2024 · 0 comments · Fixed by #4646
Assignees
Labels
Go type:bug A broken experience
Milestone

Comments

@andrueastman
Copy link
Member

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Source Build

Client library/SDK language

Go

Describe the bug

Related to microsoftgraph/msgraph-beta-sdk-go#410 and microsoft/kiota-dotnet#277

At the moment, enum parsing functions are generated with the default case returning an error. This causes failure of parsing the entire payload in such scenarios where the API is updated. To be more lenient and align with other languages, the parsing methods should return nil rather than throwing an error.

Expected behavior

Return nil for the default case.

we could make the change on the parsing side without causing a breaking change since:
the parsing methods already return a pointer
the parse node interface returns any, which can be nil

How to reproduce

Make a request to a an api that returns an undocumented enum member, error is thrown preventing the parsing of the entire payload.

Open API description file

No response

Kiota Version

main

Latest Kiota version known to work for scenario above?(Not required)

No response

Known Workarounds

No response

Configuration

all

Debug output

Click to expand log ```
</details>


### Other information

_No response_
@andrueastman andrueastman added type:bug A broken experience status:waiting-for-triage An issue that is yet to be reviewed or assigned labels May 8, 2024
@github-project-automation github-project-automation bot moved this to Todo 📃 in Kiota May 8, 2024
@andrueastman andrueastman added this to the Kiota v1.15 milestone May 8, 2024
@baywet baywet added Go and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels May 8, 2024
@andrueastman andrueastman self-assigned this May 9, 2024
@baywet baywet moved this from Todo 📃 to In Progress 🚧 in Kiota May 9, 2024
@github-project-automation github-project-automation bot moved this from In Progress 🚧 to Done ✔️ in Kiota May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Go type:bug A broken experience
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants