Using Code First to build Web APIs using Swagger 2.0 in Golang

Поделиться
HTML-код
  • Опубликовано: 26 сен 2024

Комментарии • 23

  • @MarioCarrion
    @MarioCarrion  2 года назад

    *Blog* mariocarrion.com/
    *Software Architecture and System Design in Go* ruclips.net/p/PL7yAAGMOat_GCd12Lrv_evJ3Zhv1dl8B-
    *All playlists* ruclips.net/user/MarioCarrionplaylists
    *Keep it up!*

  • @otaviocelestinodossantos1651
    @otaviocelestinodossantos1651 2 года назад +2

    Thanks for the video Mario! You can do a video showing more about Golang 1.18.1 beta, that is implementing generics! It will be very cool, i appreciate your work. Thank you!

    • @MarioCarrion
      @MarioCarrion  2 года назад +2

      Hey Otavio, yes, I plan to cover Generics and Fuzzing soon.

  • @stepanserebryakov1298
    @stepanserebryakov1298 Год назад

    Thank you! This is exactly what I need!!

    • @MarioCarrion
      @MarioCarrion  Год назад

      You're welcome, I'm glad you found the video useful. Take care.

  • @LucidGR
    @LucidGR 2 года назад

    You saved the day once again! Thanks!

  • @nirajgupta458
    @nirajgupta458 2 года назад

    Thanks for the video. Please extend this tutorial to show how to serve swagger-UI using go swagger.

    • @MarioCarrion
      @MarioCarrion  2 года назад

      Thanks Niraj, I have that covered in other video, ruclips.net/video/HwtOAc0M08o/видео.html See this commit for reference: github.com/MarioCarrion/todo-api-microservice-example/commit/074bbb9f4d0f79e5bced943c10c56013705969a9#diff-a34ecc368554b6e533d814f4a666896e22f6b1364a1be1549daec0fb3e479651

  • @rohmatmret8265
    @rohmatmret8265 2 года назад +1

    nice , but please make a video about vim your setup 😬, im very interested

    • @MarioCarrion
      @MarioCarrion  2 года назад +3

      I have a video: ruclips.net/video/1IImpI1iQow/видео.html the configuration is linked in the description. Cheers!

  • @AlexisRodriguez-rk1ts
    @AlexisRodriguez-rk1ts 2 года назад +1

    Hey Mario! Thanks for the video! I wanted to know if you will ever do a video showing how to accept payments on a website using Go. Like, for example, how to implement PayPal in a web app. Thank you!

    • @MarioCarrion
      @MarioCarrion  2 года назад +2

      Hello Alexis. Thanks for watching! I never thought about it, but thanks for the suggestion, I'll look into it. Take care.

  • @luisrivera1958
    @luisrivera1958 2 года назад

    Muchas gracias por el excelente video
    Me doy cuenta que sabes de lo que hablas porque tienes nVIM de IDE 😁👌

  • @nikhilsharma3035
    @nikhilsharma3035 11 дней назад

    do you have any video or page link where authorization is added for go-swagger? if yes please share

    • @MarioCarrion
      @MarioCarrion  10 дней назад

      Use "swagger:meta" together with "SecurityDefinitions" and "Security", something like:
      // Schemes: https
      // BasePath: /v1
      // Contact: email@.com
      // Consumes:
      // - application/json
      // Produces:
      // - application/json
      // SecurityDefinitions:
      // jwt_authorization:
      // type: apiKey
      // name: Authorization
      // description: JSON Web Token using Bearer schema.
      // in: header
      // Security:
      // - jwt_authorization:
      // Version: 0.0.1
      //
      // swagger:meta
      Read the Swagger 2.0 spec and search for "SecurityDefinitions" to see other authorization types.

  • @ecam90
    @ecam90 2 года назад

    Hey Mario - just curious as to why you would choose OpenAPI 2 instead of OpenAPI 3?? Are there any specific benefits of using 2.0 over 3?

    • @MarioCarrion
      @MarioCarrion  2 года назад +2

      Hello!
      I chose OpenAPI 2 in this episode because that's the only version go-swagger supports; which is the only tool (to my knowledge / that works) available for generating a spec for OpenAPI 2 using annotations; if you see my most recent video (Design First: ruclips.net/video/ErA92edMta8/видео.html) I'm using OpenAPI 3 (although goa, the tool I'm using; still supports OpenAPI 2).
      IMO, if there's a chance to use OpenAPI 3.0 with the tools we have available, I think we should use that version instead.

    • @ecam90
      @ecam90 2 года назад

      @@MarioCarrion Understood - that makes a lot of sense. Thanks!

  • @golangthebest7746
    @golangthebest7746 Год назад

    hello, how do I generate a swagger link/url/endpoint when I start my server? I mean you are using the editor by copying and pasting the spec file, buy I would like to generate a link on start so you can click and open swagger easily

    • @MarioCarrion
      @MarioCarrion  Год назад

      Do you mean the swagger-ui or the swagger.json?

    • @golangthebest7746
      @golangthebest7746 Год назад

      @@MarioCarrion the swagger-ui, I would like to see a video about it

    • @MarioCarrion
      @MarioCarrion  Год назад

      @@golangthebest7746 this sort of covers what you're asking ruclips.net/video/HwtOAc0M08o/видео.html
      In practice, look at this: github.com/MarioCarrion/todo-api-microservice-example/blob/097af88070ae60dc7eb86f4e4425175c45b9663e/cmd/rest-server/main.go#L234-L235
      I bundle the server binary with a version of swagger-ui.

    • @golangthebest7746
      @golangthebest7746 Год назад

      @@MarioCarrion ty very much