-
Notifications
You must be signed in to change notification settings - Fork 160
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
fix(generator): do not keep azure.core models #4598
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ public DpgOutputLibrary(string libraryName, IReadOnlyDictionary<InputEnumType, E | |
|
||
private IEnumerable<string>? _accessOverriddenModels; | ||
public IEnumerable<string> AccessOverriddenModels => _accessOverriddenModels ??= Enums.Where(e => e.IsAccessibilityOverridden).Select(e => e.Declaration.Name) | ||
.Concat(Models.Where(m => m.IsAccessibilityOverridden).Select(m => m.Declaration.Name)); | ||
.Concat(Models.Where(m => m.IsAccessibilityOverridden && (m.Namespace == null || !m.Namespace.StartsWith("Azure.Core"))).Select(m => m.Declaration.Name)); | ||
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. Well if this is the reason, I think we do not need to fix this because this really looks like a workaround, and we should not do this. 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. If we have to fix, maybe we should let emitter not generate models from azure.core. There is a flag in TCGC that to filter out azure.core models. 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. we cannot let TCGC filter out core models, because that will break other cases for emitter. and I remember in generator we already filter out core models? 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. our emitter could do this. 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. OK. Previously I thought our generator will remove core types. If that assumption is false, then it makes sense to filter out in emitter. |
||
|
||
private AspDotNetExtensionTypeProvider? _aspDotNetExtension; | ||
public AspDotNetExtensionTypeProvider AspDotNetExtension => _aspDotNetExtension ??= new AspDotNetExtensionTypeProvider(RestClients, Configuration.Namespace, _sourceInputModel); | ||
|
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.
this property is kind of misleading because the namespace of a model in its generated code should be found in
Declaration.Namespace
instead of this.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.
OK, I can change it into
OriginalNamespace
or something like thatThere 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.
that does not make sense either, this type is an "output type", it really should not provide anything that is not used in output