Skip to content

Conversation

@captainsafia
Copy link
Member

Closes #61037.

Also uncomments some tests that were commented out due to a bug in Microsoft.OpenApi.

@captainsafia captainsafia requested a review from a team as a code owner March 21, 2025 22:32
@ghost ghost added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Mar 21, 2025
@captainsafia captainsafia added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc and removed area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework labels Mar 21, 2025
SymbolEqualityComparer.Default.Equals(symbol.ContainingAssembly, assemblySymbol);
private bool IsAccessibleType(ISymbol symbol) =>
SymbolEqualityComparer.Default.Equals(symbol.ContainingAssembly, assemblySymbol)
&& (symbol.DeclaredAccessibility == Accessibility.Public ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it simpler to check for != Accessibility.Private? Or are there more accessibility states I'm forgetting?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way the Accessibility enum is modeled is kinda weird. It does it based on the modifiers in the class so protected class Foo will have Accessibility.Protected even though it is private.

/// <summary>
/// No XML comment processed here.
/// </summary>
private class Element
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this type need to be used somewhere so we can check the lack of description?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to rely on the check for compilation errors for this one. Since the type is private, we can't actually use it in the parameter list or return list for a method handler that is internal and/or public.

@captainsafia captainsafia merged commit df0c459 into main Mar 24, 2025
27 checks passed
@captainsafia captainsafia deleted the cs/xml-accessibility branch March 24, 2025 02:41
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview4 milestone Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OpenAPI] error CS0122: 'Type' is inaccessible due to its protection level

4 participants