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

Add support for Enums or collection of enum values as root of the payload #1042

Closed
baywet opened this issue Jan 25, 2024 · 2 comments · Fixed by microsoft/kiota#4360 or #1117
Closed
Assignees
Labels
bug Something isn't working WIP
Milestone

Comments

@baywet
Copy link
Member

baywet commented Jan 25, 2024

A good example of that is beta POST /deviceManagement/chromeOSOnboardingSettings/disconnect which returns chromeOSOnboardingStatus (enum)

Here are the changes we need to make:

  1. Request adapter interface need to accept objects as well for the responseType argument of the "sendPrimitiveAsync" and "sendCollectionOfPrimitiveAsync" methods
  2. reflect the changes to the implementation
  3. add a case in the implementation to call getEnumValue/getCollectionOfEnumValues when an object is provided.
  4. update kiota generation to use that method for enums, add a using to the Object of the enum, and pass that object (in CodeConstantWriter for the requests metadata constants)
  • required tests
@andrueastman
Copy link
Member

  1. Request adapter interface need to accept objects as well for the responseType argument of the "sendPrimitiveAsync" and "sendCollectionOfPrimitiveAsync" methods

Just to confirm here that we should use "sendPrimitiveAsync" and "sendCollectionOfPrimitiveAsync" or align with other langs to add sendEnumAsync and sendCollectionOfEnumsAsync.

cc @baywet

@baywet
Copy link
Member Author

baywet commented Feb 22, 2024

I think it'd make more sense to align with the other languages to be specific about what's expected from the implementations.
Especially with the reasoning you've provided here microsoft/kiota-dotnet#199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working WIP
Projects
Archived in project
4 participants