API-ly Ever After: OpenAPI in .NET 9

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ม.ค. 2025
  • In .NET 9, ASP.NET Core ships with built-in support for generating OpenAPI documents from minimal and controller-based APIs. In this session, we'll cover the key features of this new support, explore integration scenarios for OpenAPI, and discuss how your team can make the most of OpenAPI.
    Connect with .NET:
    Blog: aka.ms/dotnet/...
    Twitter: aka.ms/dotnet/...
    TikTok: aka.ms/dotnet/...
    Mastodon: aka.ms/dotnet/...
    LinkedIn: aka.ms/dotnet/...
    Facebook: aka.ms/dotnet/...
    Docs: learn.microsof...
    Forums: aka.ms/dotnet/...
    🙋‍♀️Q&A: aka.ms/dotnet-qa
    👨‍🎓Microsoft Learn: aka.ms/learndo...
    #dotnet

ความคิดเห็น • 11

  • @VladyslavHorbachov
    @VladyslavHorbachov 2 หลายเดือนก่อน +3

    Great demo! I'd like to see some presentation about Kiota and how it's integrated with current open API workflows as well.

  • @alexlo5655
    @alexlo5655 2 หลายเดือนก่อน +4

    Great demo! Do you have a source code for it on a GitHub?

  • @gibbonaci
    @gibbonaci 2 หลายเดือนก่อน +4

    what about fluentvalidation here?

    • @safiaabdalla5656
      @safiaabdalla5656 หลายเดือนก่อน +5

      We don't provide built-in support for mapping FluentValidation configurations to OpenAPI documents but it is something that FluentValidation can provide by building on top of the transformers API in their own packages.

  • @andrijs1521
    @andrijs1521 2 หลายเดือนก่อน +3

    Could you please provide source code for this presentation?

  • @eugene5096
    @eugene5096 2 หลายเดือนก่อน +2

    Thank you guys, just wonder why things that are done in schema transformer could not be done via attributes ?

    • @kurumi690
      @kurumi690 2 หลายเดือนก่อน +3

      My first thought is because of NativeAOT friendly, or we need to create some source gen

    • @safiaabdalla5656
      @safiaabdalla5656 หลายเดือนก่อน +1

      There's no out-of-the-box attributes for settings examples for types so we relay on transformers for this. For these kinds of situations, transformers provide more flexibility and reduce the amount of new API that needs to be added.

    • @passionblackbay
      @passionblackbay หลายเดือนก่อน

      @@safiaabdalla5656 Transformers work well for security schemes and requirements, but they feel awkward for defining example values. With the Swashbuckle generator, it's at least possible to use XML comments for classes and route/query params, which is more convenient. However, is there an example available for using transformers specifically with example values for route/query parameters? Having an [Example()] or [Examples()] attribute (like [description()]) would be far more convenient...

  • @gibbonaci
    @gibbonaci หลายเดือนก่อน

    There's one thing I would like to point out after initial testing, the `dotnet watch` command is not rebuilding the definitions so hot reloading needs to be turned off!