[ACS JobRouter][GA] Change discriminators to enum instead of string for all polymorphic base class#26658
Merged
weidongxu-microsoft merged 10 commits intoAzure:mainfrom Nov 14, 2023
Conversation
Next Steps to Merge✔️ All automated merging requirements have been met! Refer to step 4 in the PR workflow diagram (even if your PR is for data plane, not ARM). |
Swagger Generation Artifacts
|
Generated ApiView
|
db1f6f8 to
c4458a5
Compare
This was referenced Nov 10, 2023
…m' of https://github.com/sarkar-rajarshi/azure-rest-api-specs into rsarkar/jobrouter/try-representing-discriminator-as-enum
Member
Author
|
@jhendrixMSFT this is ready to be merged |
weidongxu-microsoft
approved these changes
Nov 14, 2023
Member
|
Breaking changes approved by Jeffrey. Change to client.tsp verified by the team. Change to example files are expected. |
|
Swagger pipeline restarted successfully, please wait for status update in this comment. |
This was referenced Nov 14, 2023
Closed
zman-ms
pushed a commit
that referenced
this pull request
Jan 10, 2024
…or all polymorphic base class (#26658) * change discriminators to enum instead of string * Mark list methods as internal * update examples * update typespec-ts option * update examples * Suppress DISCRIMINATOR_NOT_REQUIRED and INVALID_DISCRIMINATOR_TYPE * Update projected list method names for csharp * Revert * add missing package-dir in tspconfig --------- Co-authored-by: williamzhao87 <williamzhao87@gmail.com> Co-authored-by: Mike Harder <mharder@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.
Based on reviews from Azure/azure-sdk#6852
It was recommended for the discriminator property used in polymorphic classes to be exposed as extensible enums. This introduces the following enums in the spec which are now used as discriminator type instead of
strThis is also the recommended representation of discriminators Teams post (internal)
JobMatchingModeKind(used forJobMatchingMode.kind)RouterRuleKind(used forRouterRule.kind)DistributionModeKind(used forDistributionMode.kind)ExceptionTriggerKind(used forExceptionTrigger.kind)ExceptionActionKind(used forExceptionAction.kind)QueueSelectorAttachmentKind(used forQueueSelectorAttachment.kind)WorkerSelectorAttachmentKind(used forWorkerSelectorAttachment.kind)Other changes:-
Previous PR: #25763
Breaking Change: Workitem