V2 - should be compatible with AOT/trimming
While we don't need that on GA, we should at least ensure that there are no design decisions which are going to corner us.
We should at the mimum:
- add a test project
- add a target of net5/6/8
There are a number of places in this repo where reflection is present, and we should avoid it for performance/reliability reasons.
See kiota-dotnet for the test project setup.
@baywet we already have a trimming test project set up in V2 here https://github.com/microsoft/OpenAPI.NET/tree/release/2.0.0/test/Microsoft.OpenApi.Trimming.Tests
@MaggieKimani1 this is most likely not working as expected as the library csproj
- is missing net8 target (and maybe 5 and 6 depending on how low we want to support trimming)
- is missing the IsTrimmable/IsAotCompatible property
See an example
Also readers is not setup as indicated by this comment
The fact the project is not yelling at us for things like these comforts me in this hypothesis.
+1 to this. Our native AoT tests in ASP.NET Core caught some issues here (specifically with the JsonNodeCloneHelper) that will need to be addressed.