OpenAPI.NET icon indicating copy to clipboard operation
OpenAPI.NET copied to clipboard

V2 - should be compatible with AOT/trimming

Open baywet opened this issue 1 year ago • 2 comments

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 avatar Oct 14 '24 19:10 baywet

@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 avatar Oct 23 '24 09:10 MaggieKimani1

@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.

baywet avatar Oct 23 '24 11:10 baywet

+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.

captainsafia avatar Dec 16 '24 19:12 captainsafia