-
Notifications
You must be signed in to change notification settings - Fork 58
fix emitter for ADP #1659
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
Merged
Merged
fix emitter for ADP #1659
Conversation
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
Member
changlong-liu
commented
Jan 9, 2023
•
edited
Loading
edited
- fix ADP: spread models aren't generated #1645 (refering to JS's PR https://github.com/Azure/autorest.typescript/pull/1690/files#diff-2de02ede03fd3629d52db8333eb632bd105f2ea9380c9c97ecb6abbed4d5db51)
- fix getType (cache type by effectivet type)
- fix namespace
changlong-liu
commented
Jan 9, 2023
@@ -247,15 +242,16 @@ function getEffectiveSchemaType(program: Program, type: Model): Model { | |||
function getType(program: Program, type: EmitterType): any { | |||
// don't cache simple type(string, int, etc) since decorators may change the result | |||
const enableCache = !isSimpleType(program, type); | |||
const effectiveModel = type.kind === "Model" ? getEffectiveSchemaType(program, type) : type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are using effective type in emitModel
(
const modelName = getName(program, type) || getEffectiveSchemaType(program, type).name; |
changlong-liu
commented
Jan 9, 2023
packages/cadl-python/src/emitter.ts
Outdated
@@ -1256,7 +1278,8 @@ function getNamespaces(context: DpgContext): Set<string> { | |||
|
|||
function emitCodeModel(context: EmitContext<EmitterOptions>) { | |||
const dpgContext = createDpgContext(context); | |||
const clientNamespaceString = getClientNamespaceString(dpgContext); | |||
let clientNamespaceString = getClientNamespaceString(dpgContext); | |||
if (clientNamespaceString) clientNamespaceString = clientNamespaceString.toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix the comparation at
if (namespace === clientNamespaceString) { |
return getClientNamespaceString(context)!.toLowerCase(); |
…into 20230109-adp-0.38 * 'autorestv3' of https://github.com/Azure/autorest.python: have pipelines fail on regeneration failure (#1663)
iscai-msft
added a commit
that referenced
this pull request
Mar 10, 2023
…into cadl_ranch_branch * 'autorestv3' of https://github.com/Azure/autorest.python: (53 commits) Fix publish (#1667) pip dev(deps-dev): bump pylint in /packages/autorest.python (#1664) Update package.json Update ChangeLog.md Update package.json Update CHANGELOG.md fix emitter for ADP (#1659) pip dev(deps-dev): bump pyright from 1.1.274 to 1.1.287 in /packages/autorest.python (#1653) have pipelines fail on regeneration failure (#1663) clean up cadl code with tim (#1657) Update CHANGELOG.md Update package.json Update ChangeLog.md use """ pair presenting enum item docs (#1655) [WIP] flatten JSONModelType body properties as operation parameters (#1623) [cadl-python] fix import and _vendor.py for subclient (#1649) pip prod(deps): bump m2r2 from 0.3.2 to 0.3.3 in /packages/autorest.python (#1644) pip prod(deps): bump platformdirs in /packages/autorest.python (#1641) pip prod(deps): bump pathspec in /packages/autorest.python (#1642) pip prod(deps): bump json-rpc in /packages/autorest.python (#1638) ...
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.