Skip to content

Conversation

@baywet
Copy link
Member

@baywet baywet commented Jan 27, 2026

reflection of #2711 in v2

* Initial plan

* Convert PublicApi.approved.txt to PublicApiAnalyzers format

- Converted test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt (2152 lines)
  to src/Microsoft.OpenApi/PublicAPI.Shipped.txt (1844 entries)
- Generated PublicAPI.Shipped.txt and PublicAPI.Unshipped.txt files for both
  Microsoft.OpenApi and Microsoft.OpenApi.YamlReader projects
- Added Microsoft.CodeAnalysis.PublicApiAnalyzers package reference in Directory.Build.props

The conversion extracted 1843 public API declarations from the PublicApiGenerator
format and converted them to the Microsoft.CodeAnalysis.PublicApiAnalyzers format:
- Types (classes, interfaces, structs, enums, delegates)
- Constructors
- Methods
- Properties (with get/set accessors)
- Fields (including const fields)
- Events
- Enum values with their numeric assignments

Note: Build validation and potential missing API entries will need to be addressed
in follow-up work as the PublicApiAnalyzers may identify additional public APIs
not captured in the original PublicApiGenerator output.

* Populate PublicAPI.Shipped.txt for Microsoft.OpenApi project

Co-authored-by: baywet <[email protected]>

* Remove backup files

* Fix PublicAPI.Unshipped.txt for Microsoft.OpenApi.YamlReader

- Generated public API using PublicApiGenerator for Microsoft.OpenApi.YamlReader assembly
- Converted to PublicApiAnalyzers format and added to PublicAPI.Unshipped.txt
- Made static ReadFragment<T>(JsonNode...) method internal to resolve RS0016 and RS0026 analyzer errors
- Resolved RS0016/RS0017 analyzer errors for YamlReader project
- Note: RS0036 nullability annotation warnings remain but are separate from PublicAPI format issues

Co-authored-by: baywet <[email protected]>

* chore: removes old unit test based public API validation

Signed-off-by: Vincent Biret <[email protected]>

* chore: reverts copilot hallucination

Signed-off-by: Vincent Biret <[email protected]>

* chore: moves the analyzer to library projects only

* chore: refreshes API export

Signed-off-by: Vincent Biret <[email protected]>

---------

Signed-off-by: Vincent Biret <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: baywet <[email protected]>
Co-authored-by: Vincent Biret <[email protected]>
@baywet baywet requested a review from a team as a code owner January 27, 2026 20:44
@baywet baywet self-assigned this Jan 27, 2026
@baywet baywet enabled auto-merge January 27, 2026 20:44
@sonarqubecloud
Copy link

@baywet baywet merged commit 38adbf5 into support/v2 Jan 27, 2026
17 checks passed
@baywet baywet deleted the ci/public-analyzers-to-v2 branch January 27, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants