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

Don't generate prop if custom prop exists in base #4682

Merged

Conversation

jorgerangel-msft
Copy link
Contributor

@jorgerangel-msft jorgerangel-msft commented Oct 10, 2024

This PR address the following bugs:

  • If a model contains a spec property that was also added as a custom model in it's base model, the derived model will not generate the property.
  • if a custom property is added to a base model and it includes the CodeGenSerialization attribute, that property is included in serialization ctor for the derived model.

fixes: #4629

@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Oct 10, 2024
@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@jorgerangel-msft jorgerangel-msft marked this pull request as ready for review October 10, 2024 19:48
@jorgerangel-msft jorgerangel-msft marked this pull request as draft October 10, 2024 22:38
@jorgerangel-msft jorgerangel-msft marked this pull request as ready for review October 10, 2024 23:00
@jorgerangel-msft jorgerangel-msft added this pull request to the merge queue Oct 11, 2024
Merged via the queue into microsoft:main with commit ff1725c Oct 11, 2024
21 checks passed
@jorgerangel-msft jorgerangel-msft deleted the duplicate-custom-prop branch October 11, 2024 16:58
swatkatz pushed a commit to swatkatz/typespec that referenced this pull request Nov 5, 2024
This PR address the following bugs:
- If a model contains a spec property that was also added as a custom
model in it's base model, the derived model will not generate the
property.
- if a custom property is added to a base model and it includes the
`CodeGenSerialization` attribute, that property is included in
serialization ctor for the derived model.

fixes: microsoft#4629
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenAI - Should not generate property if it is contained on a custom model base type
4 participants