This repository was archived by the owner on Jul 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 87
tsp, use TCGC's name for model property schema and parameter name #2787
Merged
haolingdong-msft
merged 11 commits into
Azure:main
from
haolingdong-msft:getallmodels-name
May 30, 2024
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bfe989b
use TCGC's name for model property schema name and union
haolingdong-msft 7f7ca73
regen
haolingdong-msft d61a060
remove unused functions
haolingdong-msft d5da0a4
change the union schema's name back
haolingdong-msft 8945013
use tcgc name for constant schema
haolingdong-msft 399b3c0
fix tests
haolingdong-msft 9e42adb
remove the logic of getting name from raw model and scalar
haolingdong-msft 7c5d86b
regen
haolingdong-msft 6472b88
Merge branch 'main' into getallmodels-name
haolingdong-msft 925d805
clean up unused function
haolingdong-msft a8fb9ce
Merge remote-tracking branch 'origin/getallmodels-name' into getallmo…
haolingdong-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,35 +5,35 @@ | |
| package com.cadl.literalservice.models; | ||
|
|
||
| /** | ||
| * Defines values for ModelOptionalLiteral. | ||
| * Defines values for ModelOptionalLiteralOptionalLiteral. | ||
| */ | ||
| public enum ModelOptionalLiteral { | ||
| public enum ModelOptionalLiteralOptionalLiteral { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @srnagar, we now leverage TCGC to generate the name for optional literal enum. And their logic is to concat the literal value to the enum's name. e.g. the definitiion is |
||
| /** | ||
| * Enum value optionalLiteral. | ||
| */ | ||
| OPTIONAL_LITERAL("optionalLiteral"); | ||
|
|
||
| /** | ||
| * The actual serialized value for a ModelOptionalLiteral instance. | ||
| * The actual serialized value for a ModelOptionalLiteralOptionalLiteral instance. | ||
| */ | ||
| private final String value; | ||
|
|
||
| ModelOptionalLiteral(String value) { | ||
| ModelOptionalLiteralOptionalLiteral(String value) { | ||
| this.value = value; | ||
| } | ||
|
|
||
| /** | ||
| * Parses a serialized value to a ModelOptionalLiteral instance. | ||
| * Parses a serialized value to a ModelOptionalLiteralOptionalLiteral instance. | ||
| * | ||
| * @param value the serialized value to parse. | ||
| * @return the parsed ModelOptionalLiteral object, or null if unable to parse. | ||
| * @return the parsed ModelOptionalLiteralOptionalLiteral object, or null if unable to parse. | ||
| */ | ||
| public static ModelOptionalLiteral fromString(String value) { | ||
| public static ModelOptionalLiteralOptionalLiteral fromString(String value) { | ||
| if (value == null) { | ||
| return null; | ||
| } | ||
| ModelOptionalLiteral[] items = ModelOptionalLiteral.values(); | ||
| for (ModelOptionalLiteral item : items) { | ||
| ModelOptionalLiteralOptionalLiteral[] items = ModelOptionalLiteralOptionalLiteral.values(); | ||
| for (ModelOptionalLiteralOptionalLiteral item : items) { | ||
| if (item.toString().equalsIgnoreCase(value)) { | ||
| return item; | ||
| } | ||
|
|
||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.