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

Advanced multipart implementation #2740

Merged
merged 37 commits into from
Aug 20, 2024
Merged

Conversation

msyyc
Copy link
Member

@msyyc msyyc commented Aug 5, 2024

@msyyc msyyc marked this pull request as ready for review August 13, 2024 09:17
@msyyc msyyc changed the title [WIP] Advanced multipart implementation Advanced multipart implementation Aug 13, 2024
@msyyc msyyc enabled auto-merge (squash) August 14, 2024 01:46
@@ -165,6 +165,9 @@ async function getSubdirectories(baseDir: string, flags: RegenerateFlags): Promi
// after xml support, remove this check
if (mainTspRelativePath.includes("xml")) return;

// after fix test generation for nested operation group, remove this check
if (mainTspRelativePath.includes("client-operation-group")) return;

Copy link
Member Author

Choose a reason for hiding this comment

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

Will make another PR to fix test generation for this case

@msyyc msyyc disabled auto-merge August 14, 2024 01:47
@msyyc msyyc requested a review from iscai-msft August 15, 2024 05:05
codeModel["subnamespaceToClients"][client.nameSpace] = emitClient(sdkContext, client);
}
}
// loop through models and enums since there may be some orphaned models needs to be generated
for (const model of sdkPackage.models) {
Copy link
Member Author

@msyyc msyyc Aug 16, 2024

Choose a reason for hiding this comment

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

Put loop for models/enums behind emitClients so that we could collect models which will not be generated (e.g. models for multipart file part) and disable them by not calling getType to add them into typesMap

@@ -624,3 +624,29 @@ def instance_check_template(self) -> str:
@property
def serialization_type(self) -> str:
return self.name


class MultiPartFileType(PrimitiveType):
Copy link
Member Author

Choose a reason for hiding this comment

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

With the new type, we don't need special logic in docstring/typing annotation for multipart properties anymore. And it is much easier to evolve in the future.

@msyyc msyyc requested a review from tadelesh August 19, 2024 10:09
@iscai-msft iscai-msft merged commit 8ac5289 into main Aug 20, 2024
15 checks passed
@iscai-msft iscai-msft deleted the advanced-multipart-implementation branch August 20, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multipart Form Data Implementation
3 participants