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

Remove stringify from primitive types #5616

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

shemogumbe
Copy link
Contributor

@shemogumbe shemogumbe commented Oct 16, 2024

Fixes #5417

From

async def get(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[List[str]]:
        """
        Get names
        param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
        Returns: Optional[List[str]]
        """
        request_info = self.to_get_request_information(
            request_configuration
        )
        if not self.request_adapter:
            raise Exception("Http core is null") 
        return await self.request_adapter.send_collection_of_primitive_async(request_info, "str", None)

To

async def get(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[List[str]]:
        """
        Get names
        param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
        Returns: Optional[List[str]]
        """
        request_info = self.to_get_request_information(
            request_configuration
        )
        if not self.request_adapter:
            raise Exception("Http core is null") 
        return await self.request_adapter.send_collection_of_primitive_async(request_info, str, None)

Note - the param type was fixed in an earlier PR for a related issue in September

@shemogumbe shemogumbe marked this pull request as ready for review October 16, 2024 14:25
@shemogumbe shemogumbe requested a review from a team as a code owner October 16, 2024 14:25
Copy link
Member

@andrueastman andrueastman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd also need a changelog entry for this as well...

.vscode/launch.json Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Oct 16, 2024

@@ -25,6 +25,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed cyclic dependencies in generated Go code. [#2834](https://github.com/microsoft/kiota/issues/2834)
- Fixed a bug where default output folder is created on plugin edit and generate commands. [#5510](https://github.com/microsoft/kiota/issues/5429)
- Changed GeneratedCode attribute applied when generating CSharp to only include the major version of Kiota. [#5489](https://github.com/microsoft/kiota/issues/5489)
- Fixed genarating CSharp client displays clean hint regardless of whether --clean-output is already passed [#5576](https://github.com/microsoft/kiota/issues/5576)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be moved to the unreleased section

@@ -806,7 +806,8 @@ private string GetSerializationMethodName(CodeTypeBase propType)
private string GetTypeFactory(bool isVoid, bool isStream, string returnType)
{
if (isVoid) return string.Empty;
if (isStream || conventions.IsPrimitiveType(returnType)) return $" \"{returnType}\",";
if (isStream || conventions.IsPrimitiveType(returnType)) return $" {returnType},";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we update/add a unit test for this so we prevent future regressions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress 🚧
Development

Successfully merging this pull request may close these issues.

Incorrect primitive_type in generated code causes "Encountered an unknown type during deserialization str"
3 participants