From 19b9c00be5faa5fbbbd63ca2b9bfd5d7507cf997 Mon Sep 17 00:00:00 2001 From: Saurabh Chatterjee <2438415+saurabhchatterjee23@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:01:24 +0530 Subject: [PATCH] Update README.md (#1698) Adding instructions to finish the steps in `Getting started` section before `How to use it with Gin` It is easy for anybody to miss out that section which causes unwanted failures in the Swagger UI --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index bc23607b3..b3c26eca5 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,9 @@ swag init ``` Make sure to import the generated `docs/docs.go` so that your specific configuration gets `init`'ed. If your General API annotations do not live in `main.go`, you can let swag know with `-g` flag. + ```go + import _ "example-module-name/docs" + ``` ```sh swag init -g http/api.go ``` @@ -143,6 +146,7 @@ OPTIONS: Find the example source code [here](https://github.com/swaggo/swag/tree/master/example/celler). +Finish the steps in [Getting started](#getting-started) 1. After using `swag init` to generate Swagger 2.0 docs, import the following packages: ```go import "github.com/swaggo/gin-swagger" // gin-swagger middleware