-
Notifications
You must be signed in to change notification settings - Fork 58
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
Conversation
…advanced-multipart-implementation
…m/Azure/autorest.python into advanced-multipart-implementation
@@ -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; | |||
|
There was a problem hiding this comment.
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
packages/typespec-python/generator/pygen/codegen/models/primitive_types.py
Outdated
Show resolved
Hide resolved
packages/typespec-python/generator/pygen/codegen/serializers/model_serializer.py
Outdated
Show resolved
Hide resolved
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) { |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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.
fix #2489 and #2488
bodyParam
ofSdkHttpOperation
typespec-azure#1281HttpPart
cadl-ranch#613