Photo by Andrea Piacquadio from Pexels



go run cmd\e-food-server\main.go --scheme http --port=8080


1. Pointer Struct Methods


1. Define security in swagger.yaml

securityDefinitions:  
Bearer:
type: apiKey
name: Authorization
in: header

2. Create restricted API


If you are new to go-swagger, I would recommend you to read the introduction and implementation part of this amazing framework.

Shashank Vivek

is a Fullstack Tech enthusiast. Find him on https://shashankvivek.github.io/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store