Skip to content

Advanced multipart implementation#2740

Merged
iscai-msft merged 37 commits intomainfrom
advanced-multipart-implementation
Aug 20, 2024
Merged

Advanced multipart implementation#2740
iscai-msft merged 37 commits intomainfrom
advanced-multipart-implementation

Conversation

@msyyc
Copy link
Copy Markdown
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

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

Copy link
Copy Markdown
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
Comment thread packages/typespec-python/generator/pygen/codegen/models/primitive_types.py Outdated
Comment thread packages/typespec-python/generator/pygen/codegen/serializers/model_serializer.py Outdated
Comment thread packages/typespec-python/src/types.ts Outdated
@msyyc msyyc requested a review from iscai-msft August 15, 2024 05:05
}
}
// loop through models and enums since there may be some orphaned models needs to be generated
for (const model of sdkPackage.models) {
Copy link
Copy Markdown
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

return self.name


class MultiPartFileType(PrimitiveType):
Copy link
Copy Markdown
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.

Comment thread packages/typespec-python/src/code-model.ts
Comment thread packages/typespec-python/src/types.ts
@msyyc msyyc requested a review from tadelesh August 19, 2024 10:09
@iscai-msft iscai-msft merged commit 8ac5289 into main Aug 20, 2024
@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