Fix flatten read-only properties case#4006
Merged
v-jiaodi merged 6 commits intoAzure:mainfrom Mar 6, 2026
Merged
Conversation
Collaborator
|
All changed packages have been documented.
Show changes
|
commit: |
Collaborator
|
You can try these changes here
|
19 tasks
msyyc
approved these changes
Mar 6, 2026
github-merge-queue bot
pushed a commit
to microsoft/typespec
that referenced
this pull request
Mar 6, 2026
…del scenarios (#9949) Adds Python SDK mock API tests for the Spector scenarios introduced/fixed in [Azure/typespec-azure#4006](Azure/typespec-azure#4006), which corrected the `flattenReadOnlyModel` response shape so read-only properties are returned wrapped in a `properties` object rather than flattened to the parent level. ## Changes - **Dependency bump**: `@azure-tools/azure-http-specs` `0.1.0-alpha.38-dev.2` → `0.1.0-alpha.38-dev.6` to pick up the new/updated Spector scenarios - **New sync + async tests** in `test_azure_client_generator_core_flatten[_async].py`: - `test_put_flatten_unknown_model` — verifies `properties` is **not** flattened for `unknown` (non-model) types - `test_put_flatten_read_only_model` — verifies the response returns read-only properties wrapped under `properties`: ```python def test_put_flatten_read_only_model(client: FlattenPropertyClient): result = client.put_flatten_read_only_model(Solution(name="foo")) assert result == Solution( name="foo", properties=SolutionProperties(solution_id="solution1", title="Solution Title", content="Solution Content"), ) ``` <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[python] add test case for Azure/typespec-azure#4006 > </issue_title> > <issue_description>follow skill https://github.com/microsoft/typespec/blob/main/.github/skills/python-sdk-spector-mock-api-tests/SKILL.md to write test case for Azure/typespec-azure#4006 > </issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #9948 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- 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.
the response body shall be wrapped with
propertiesorpropertiesOptional