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 useless model for multipart #2848

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .chronus/changes/fix-multipart-2024-2024-8-23-16-11-40.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@azure-tools/typespec-python"
---

Remove useless model for multipart
1 change: 1 addition & 0 deletions packages/typespec-python/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ function emitProperty<TServiceOperation extends SdkServiceOperation>(
if (body) {
// for `temperature: HttpPart<{@body body: float64, @header contentType: "text/plain"}>`, the real type is float64
sourceType = body.type;
addDisableGenerationMap(property.type);
}
}
if (isMultipartFileInput) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest": "Payload.MultiPart.FileWithHttpPartRequiredContentTypeRequest",
"payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest": "Payload.MultiPart.FileWithHttpPartSpecificContentTypeRequest",
"payload.multipart.models.FloatRequest": "Payload.MultiPart.FormData.HttpParts.NonString.float.Request.anonymous",
"payload.multipart.models.FloatRequestTemperature": "Payload.MultiPart.FormData.HttpParts.NonString.float.Request.temperature.anonymous",
"payload.multipart.models.JsonPartRequest": "Payload.MultiPart.JsonPartRequest",
"payload.multipart.models.MultiBinaryPartsRequest": "Payload.MultiPart.MultiBinaryPartsRequest",
"payload.multipart.models.MultiPartRequest": "Payload.MultiPart.MultiPartRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from ._models import FileWithHttpPartRequiredContentTypeRequest
from ._models import FileWithHttpPartSpecificContentTypeRequest
from ._models import FloatRequest
from ._models import FloatRequestTemperature
from ._models import JsonPartRequest
from ._models import MultiBinaryPartsRequest
from ._models import MultiPartRequest
Expand All @@ -31,7 +30,6 @@
"FileWithHttpPartRequiredContentTypeRequest",
"FileWithHttpPartSpecificContentTypeRequest",
"FloatRequest",
"FloatRequestTemperature",
"JsonPartRequest",
"MultiBinaryPartsRequest",
"MultiPartRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles
super().__init__(*args, **kwargs)


class FloatRequestTemperature(_model_base.Model):
"""FloatRequestTemperature."""


class JsonPartRequest(_model_base.Model):
"""JsonPartRequest.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from ._models import FileWithHttpPartRequiredContentTypeRequest
from ._models import FileWithHttpPartSpecificContentTypeRequest
from ._models import FloatRequest
from ._models import FloatRequestTemperature
from ._models import JsonPartRequest
from ._models import MultiBinaryPartsRequest
from ._models import MultiPartRequest
Expand All @@ -31,7 +30,6 @@
"FileWithHttpPartRequiredContentTypeRequest",
"FileWithHttpPartSpecificContentTypeRequest",
"FloatRequest",
"FloatRequestTemperature",
"JsonPartRequest",
"MultiBinaryPartsRequest",
"MultiPartRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles
super().__init__(*args, **kwargs)


class FloatRequestTemperature(_model_base.Model):
"""FloatRequestTemperature."""


class JsonPartRequest(_model_base.Model):
"""JsonPartRequest.

Expand Down
Loading