[typespec-python] Regenerate tests from microsoft/typespec PR #11087#48067
Merged
msyyc merged 1 commit intoJul 16, 2026
Merged
Conversation
|
Azure Pipelines: 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
l0lawrence
reviewed
Jul 15, 2026
| from .._utils.serialization import Deserializer, Serializer | ||
| from ..property.aio.operations import PropertyOperations | ||
| from ._configuration import BooleanClientConfiguration | ||
| from .operations import PropertyOperations |
Member
There was a problem hiding this comment.
this is no long the async import PropertyOperations?
Member
Author
There was a problem hiding this comment.
we configure namespace in regenerate-common.ts like https://github.com/microsoft/typespec/pull/11087/changes#diff-6d3a02078e3812a5ae4eb5b94e9f07952450932adb30a87dea6664ef8a270323 so the generated code structure is changed but the SDK API is not changed.
msyyc
marked this pull request as ready for review
July 16, 2026 02:48
|
Azure Pipelines: 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
live1206
pushed a commit
to live1206/typespec
that referenced
this pull request
Jul 16, 2026
… fix boolean-as-string encoding (microsoft#11087) Adds Python SDK mock API test coverage for the `encode/boolean` Spector scenarios from microsoft#10875 (`@encode(string)` on boolean types). This required updating multiple layers of the Python codegen stack. ## Generator fixes **`types.ts` — property emission** Preserves boolean `@encode(string)` metadata from the compiler and maps it to the Python runtime’s `"str"` format token. **`primitive_types.py` — `BooleanType`** Detects `yaml_data["encode"] == "string"` and sets `self.encode = "str"`, mirroring `IntegerType`. **`model_base.py.jinja2`** Adds `_deserialize_bool_as_str` for case-insensitive string-to-boolean deserialization: ```python def _deserialize_bool_as_str(attr: str) -> bool: return attr.lower() == "true" ``` Also dispatches to it when `annotation is bool and rf._format == "str"`. ## Test coverage Adds sync and async tests for Azure and unbranded clients covering: - `trueLower` — `"true"` → `True` - `falseLower` — `"false"` → `False` - `trueUpper` — `"TRUE"` → `True` - `falseMixed` — `"FaLsE"` → `False` ## Dependencies - Uses `@typespec/compiler` 1.14, which supports boolean `@encode(string)`. - Uses `@typespec/http-specs` `0.1.0-alpha.39`, containing the `encode/boolean` scenarios. - Adds `encode/boolean` to `regenerate-common.ts`. ## Code diff: Azure/azure-sdk-for-python#48067 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: This PR exists only to display the code diff. Please do not merge it.
Fixes #48066
Source: microsoft/typespec#11087
Automated regeneration of TypeSpec Python generated tests from microsoft/typespec PR #11087.
This PR was auto-generated. Re-run the workflow to update it after new commits are pushed to the upstream TypeSpec PR