Upgrade to Pro — share decks privately, control downloads, hide ads and more …

.NET Day 2025: The best ways to use the latest ...

.NET Day 2025: The best ways to use the latest OpenAPI features in .NET 9!

Avatar for dotnetday

dotnetday

August 29, 2025
Tweet

More Decks by dotnetday

Other Decks in Technology

Transcript

  1. .NET OpenAPI Let’s learn about the best ways to use

    OpenAPI in .NET 9 and 10! .NET Day Switzerland 2025 Sander ten Brinke https://github.com/sander1095/openapi-dotnet9-talk https://stenbrinke.nl New to OpenAPI or its use-cases? Read my blog post!
  2. Sander ten Brinke • Senior Software Engineer & Knowledge Officer

    @ Arcady • Backend, App, Cloud, DevOps, Frontend.. sander1095 [email protected] stenbrinke.nl Let’s connect! @sandertenbrinke Sander ten Brinke New to OpenAPI or its use-cases? Read my blog post!
  3. Agenda A refresher on OpenAPI OpenAPI in .NET 9 The

    future of OpenAPI in .NET Conclusion Resources Questions Feel free to interrupt and ask questions! Demos New to OpenAPI or its use-cases? Read my blog post!
  4. OpenAPI Tooling https://openapi.tools API Client generators Mock servers API testing

    Documentation 350+ tools! New to OpenAPI or its use-cases? Read my blog post!
  5. History of Swagger and OpenAPI 2011 • Swagger 1.0 2014

    • Swagger 2.0 2015 • Renamed to OpenAPI 2017 • OpenAPI 3.0.0 2021 • OpenAPI 3.1.0 End of 2024? • OpenAPI 4.0 (Moonwalk)
  6. AOT Support! • Faster application startup! • Smaller binaries and

    containers! • Less memory usage! • Reflection is problematic for AOT! • Controllers do not support AOT!
  7. Breaking changes! XML Comments are not supported in .NET 9

    https://github.com/dotnet/aspnetcore/issues/39927 https://github.com/martincostello/openapi-extensions (2/2)
  8. Customizing OpenAPI documents Set up OpenAPI specific information •Contact information

    •ExternalDocs •Servers •Etc… Transform data •Document •Operations •Schemas
  9. Generating OpenAPI documents at build-time cat bin/Debug/net9.0/{ProjectName}.json • Read generated

    OpenAPI document dotnet build • Build the ASP.NET Core application • Add required package dotnet add package Microsoft.Extensions.ApiDescription.Server Why: Store in source control, lint in pipeline, run integration tests...
  10. The future of OpenAPI in .NET 10? My PR’s! •I’ve

    merged 5+ pull requests in ASP.NET Core’s OpenAPI module for .NET 10! XML comment support •Currently in preview! OpenAPI v3.1 support •OpenAPI v4 support is unlikely.. Better build- time generation? •The current package wasn’t built for Microsoft’s own library Other features •Attaching transformers to endpoints directly •YAML support •Bug fixes
  11. Conclusion .NET 9 and 10 contain lots of changes for

    OpenAPI! AOT support is one of the biggest changes, next to Microsoft shipping their own OpenAPI library, which changes the way you set up OpenAPI in .NET projects. By decorating your API endpoints royally with OpenAPI metadata, you’ll make your API easier to use, so try to do this much as possible! Scan me or !
  12. Useful resources • https://openapi.tools • https://openapis.org • https://tinyurl.com/openapi-dotnet9-docs • https://github.com/dotnet/aspnetcore/

    • https://stenbrinke.nl/blog/openapi-api-client-generation • Demo: https://github.com/sander1095/openapi-dotnet9-talk Feel free to take a picture ! Scan me or !
  13. Sander ten Brinke Thanks for attending! Questions? Feedback? sander1095 [email protected]

    stenbrinke.nl Let’s connect! @sandertenbrinke Scan me or !