{"id":47036320,"url":"https://github.com/go-swagno/swagno","last_synced_at":"2026-04-23T13:00:48.064Z","repository":{"id":58403371,"uuid":"531429104","full_name":"go-swagno/swagno","owner":"go-swagno","description":"Generate Swagger 2.0 or OpenAPI 3.0 documentation for Go with \"no\" annotations, \"no\" files, \"no\" command","archived":false,"fork":false,"pushed_at":"2026-03-11T23:26:27.000Z","size":855,"stargazers_count":109,"open_issues_count":9,"forks_count":19,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-03-12T04:35:43.672Z","etag":null,"topics":["go","golang","openapi","openapi-codegen","openapi-documentation","openapi-generator","openapi-specification","openapi3","swagger","swagger-ui","swagger2","without-annotations","without-files","without-run"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-swagno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-01T08:27:06.000Z","updated_at":"2026-03-11T23:25:49.000Z","dependencies_parsed_at":"2023-12-19T00:45:01.743Z","dependency_job_id":"2488e499-e3ff-4cf8-92f5-14a127f5aeb2","html_url":"https://github.com/go-swagno/swagno","commit_stats":{"total_commits":61,"total_committers":4,"mean_commits":15.25,"dds":"0.049180327868852514","last_synced_commit":"434385abf37109a10b0cb9f38c7dd02daa3c7106"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/go-swagno/swagno","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-swagno%2Fswagno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-swagno%2Fswagno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-swagno%2Fswagno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-swagno%2Fswagno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-swagno","download_url":"https://codeload.github.com/go-swagno/swagno/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-swagno%2Fswagno/sbom","scorecard":{"id":432534,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-swagno/swagno","commit":"5d883645261e9ac373d36accc6ffaaedba5857c4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":2,"reason":"Found 5/23 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-2574 / GHSA-fmg4-x8pw-hjhg","Warn: Project is vulnerable to: GO-2024-2959 / GHSA-98j2-3j3p-fw2v","Warn: Project is vulnerable to: GO-2025-3845 / GHSA-qx2q-88mx-vhg7","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T03:42:27.728Z","repository_id":58403371,"created_at":"2025-08-19T03:42:27.729Z","updated_at":"2025-08-19T03:42:27.729Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32181374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T11:42:27.955Z","status":"ssl_error","status_checked_at":"2026-04-23T11:42:18.877Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","openapi","openapi-codegen","openapi-documentation","openapi-generator","openapi-specification","openapi3","swagger","swagger-ui","swagger2","without-annotations","without-files","without-run"],"created_at":"2026-03-12T01:16:00.880Z","updated_at":"2026-04-23T13:00:48.032Z","avatar_url":"https://github.com/go-swagno.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swagno: _`no` annotations, `no` files, `no` commands_\n\n![Swagno Logo](https://user-images.githubusercontent.com/1047345/188009539-ea9d0106-979d-4f98-83a3-0d7df6969c9f.png \"Swagno\")\n\nSwagno redefines the way API documentation is created, embedding documentation seamlessly into your codebase for a clutter-free, streamlined experience. This tool does away with the hassles of annotations, exported files, and command executions. Simplify your documentation process with Swagno. Embrace the ease: Swagno - no annotations, no exports, no commands!\n\n**🚀 Now supports both Swagger 2.0 and [OpenAPI 3.0](https://github.com/go-swagno/swagno/v3)!**\n\n## About the Project\n\nThis project inspired by [Swaggo](https://github.com/swaggo/swag). Swaggo, uses annotations, exports files and needs to run by command. If you don't like this way, [Swag**no**](https://github.com/go-swagno/swagno) appears as a good alternative.\n\n## Versions\n\nSwagno supports both specification versions:\n\n- **v2 (default)**: Swagger 2.0 specification - Use the main package `github.com/go-swagno/swagno`\n- **v3**: OpenAPI 3.0.3 specification - Use the v3 package `github.com/go-swagno/swagno/v3`\n\n### OpenAPI 3.0 Support 🆕\n\nStarting with v3, Swagno now supports OpenAPI 3.0.3 specification with enhanced features:\n\n```go\n// OpenAPI 3.0 usage\nimport swagno3 \"github.com/go-swagno/swagno/v3\"\n\nopenapi := swagno3.New(swagno3.Config{\n    Title:   \"My API\",\n    Version: \"v1.0.0\",\n})\nopenapi.AddServer(\"https://api.example.com/v1\", \"Production server\")\nopenapi.SetBearerAuth(\"JWT\", \"Bearer authentication\")\n```\n\n**New OpenAPI 3.0 Features:**\n\n- ✅ Multiple servers support\n- ✅ Enhanced security schemes (Bearer, OpenID Connect)\n- ✅ Proper request body handling with content types\n- ✅ Improved schema definitions with nullable, readOnly, writeOnly\n- ✅ Better parameter validation and examples\n- ✅ Components-based architecture\n\n[📖 See v3 documentation](v3/README.md) for detailed OpenAPI 3.0 usage and migration guide.\n\n## Contents\n\n- [Examples](example/)\n- [Getting started](#getting-started)\n- [Supported Web Frameworks](#supported-web-frameworks)\n- [Implementation Status](#implementation-status)\n- [Create Your Swagger](#create-your-swagger)\n  - [General Swagger Info](#general-swagger-info)\n  - [Endpoints (API)](#endpoints-api)\n    - [Endpoint Options](#endpoint-options)\n  - [Parameters](#parameters)\n    - [Parameter Location](#parameter-location)\n    - [Parameter Types](#parameter-types)\n    - [Parameter Options](#parameter-options)\n  - [Defining Models](#defining-models)\n  - [Security](#security-optional)\n- [Contribution](#contribution)\n\n## Getting started\n\n0. Server Example [here](example/http/server.go)\n\n1. Get swagno package in your project\n\n```sh\ngo get github.com/go-swagno/swagno\n```\n\n2. Import swagno\n\n```go\nimport \"github.com/go-swagno/swagno\"\nimport \"github.com/go-swagno/swagno-http/swagger\" // recommended if you want to use go-swagno http handler for serving swagger docs\n```\n\n3. Create your endpoints (check [Endpoints](#endpoints-api)) with it's corresponding parameters. Example:\n\n```go\n endpoints := []*endpoint.EndPoint{\n  endpoint.New(\n    endpoint.GET,\n    \"/product/page\",\n    endpoint.WithTags(\"product\"),\n    endpoint.WithSuccessfulReturns([]response.Response{response.New(models.EmptySuccessfulResponse{}, \"OK\", \"200\")}),\n    endpoint.WithErrors([]response.Response{response.New(models.UnsuccessfulResponse{}, \"Bad Request\", \"400\")}),\n    endpoint.WithDescription(desc),\n    endpoint.WithProduce([]mime.MIME{mime.JSON, mime.XML}),\n    endpoint.WithConsume([]mime.MIME{mime.JSON}),\n  ),\n  endpoint.New(\n    endpoint.GET,\n    \"/product\",\n    endpoint.WithTags(\"product\"),\n    endpoint.WithParams(parameter.IntParam(\"id\", parameter.WithRequired())),\n    endpoint.WithSuccessfulReturns([]response.Response{response.New(models.EmptySuccessfulResponse{}, \"OK\", \"200\")}),\n    endpoint.WithErrors([]response.Response{response.New(models.UnsuccessfulResponse{}, \"Bad Request\", \"400\")}),\n  ),\n  endpoint.New(\n    endpoint.GET,\n    \"/product/{id}/detail\",\n    endpoint.WithTags(\"product\"),\n    endpoint.WithParams(parameter.IntParam(\"id\", parameter.WithRequired())),\n    endpoint.WithSuccessfulReturns([]response.Response{response.New(models.EmptySuccessfulResponse{}, \"OK\", \"200\")}),\n    endpoint.WithErrors([]response.Response{response.New(models.UnsuccessfulResponse{}, \"Bad Request\", \"400\")}),\n  ),\n  endpoint.New(\n    endpoint.POST,\n    \"/product\",\n    endpoint.WithTags(\"product\"),\n    endpoint.WithBody(models.ProductPost{}),\n    endpoint.WithSuccessfulReturns([]response.Response{response.New(models.EmptySuccessfulResponse{}, \"OK\", \"200\")}),\n    endpoint.WithErrors([]response.Response{response.New(models.UnsuccessfulResponse{}, \"Bad Request\", \"400\")}),\n    endpoint.WithProduce([]mime.MIME{mime.JSON, mime.XML}),\n  ),\n}\n```\n\n4. Create Swagger(swagno) instance\n\n```go\nsw := swagno.New(swagno.Config{Title: \"Testing API\", Version: \"v1.0.0\", Host: \"localhost:8080\"})\n```\n\n5. Use sw.AddEndpoints function to add endpoints arrays to Swagno\n\n```go\nsw.AddEndpoints(endpoints)\n\n// you can also add more arrays\nsw.AddEndpoints(productEndpoints)\nsw.AddEndpoints(merchantEndpoints)\n```\n\n6. Generate json as string and give it to your handler to serve. You can create your own handler or use the swagno http handler\n\n```go\n http.HandleFunc(\"/swagger/\", swagger.SwaggerHandler(sw.MustToJson()))\n fmt.Println(\"Server is running on http://localhost:8080\")\n http.ListenAndServe(\":8080\", nil)\n```\n\n## Supported Web Frameworks\n\n- [fiber](https://github.com/go-swagno/swagno-fiber)\n- [gin](https://github.com/go-swagno/swagno-gin)\n- [gorilla/mux](https://github.com/go-swagno/swagno-http)\n- [net/http](https://github.com/go-swagno/swagno-http)\n\n## How to use with Fiber\n\nYou can read detailed document and find better examples in [swagno-fiber](https://github.com/go-swagno/swagno-fiber)\n\nExample:\n\n1. Get swagno-fiber\n\n```sh\ngo get github.com/go-swagno/swagno-fiber\n```\n\n2. Import swagno-fiber\n\n```go\nimport \"github.com/go-swagno/swagno-fiber/swagger\"\n```\n\n3.\n\n```go\n...\n// assume you declare your endpoints and \"sw\"(swagno) instance\nswagger.SwaggerHandler(a, sw.MustToJson(), swagger.WithPrefix(\"/swagger\"))\n...\n```\n\nYou can find a detailed example in [https://github.com/go-swagno/swagno/example/fiber](https://github.com/go-swagno/swagno/tree/master/example/fiber)\n\n## How to use with Gin\n\nYou can read detailed document and find better examples in [swagno-gin](https://github.com/go-swagno/swagno-gin)\n\nExample:\n\n1. Get swagno-gin\n\n```sh\ngo get github.com/go-swagno/swagno-gin\n```\n\n2. Import swagno-gin\n\n```go\nimport \"github.com/go-swagno/swagno-gin/swagger\"\n```\n\n3.\n\n```go\n...\n// assume you declare your endpoints and \"sw\"(swagno) instance\na.GET(\"/swagger/*any\", swagger.SwaggerHandler(sw.MustToJson()))\n...\n```\n\nYou can find a detailed example in [https://github.com/go-swagno/swagno/example/gin](https://github.com/go-swagno/swagno/tree/master/example/gin)\n\n## Implementation Status\n\nAs purpose of this section, you can compare **swagno** status with **swaggo**\n\n[Swagger 2.0 document](https://swagger.io/docs/specification/2-0/basic-structure/)\n\nSee how Swagno compares to Swaggo in terms of Swagger 2.0 features:\n\n- Basic Structure: ✅\n- API Host and Base Path: ✅\n- Paths and Operations: ✅\n- Describing Parameters: ✅\n- Describing Request Body: ✅\n- Describing Responses: ✅\n- MIME Types: 🔄 (Improvement needed)\n- Authentication: ✅\n- File Upload: 🔄 (Improvement needed)\n- Enums: ✅\n- Grouping Operations With Tags: ✅\n- Swagger Extensions: 🔜 (Coming soon)\n- Swagger Validation: 🔜 (Coming soon)\n\n# Create Your Swagger\n\n## General Swagger Info\n\nSwagger v2.0 specifications can be found [here](https://swagger.io/specification/v2/)\n\nYou can use the swagger config when creating new swagger object\n\n```go\ntype Config struct {\n  Title          string   // title of the Swagger documentation\n  Version        string   // version of the Swagger documentation\n  Description    string   // description of the Swagger documentation\n  Host           string   // host URL for the API\n  Path           string   // path to the Swagger JSON file\n  License        *License // license information for the Swagger documentation\n  Contact        *Contact // contact information for the Swagger documentation\n  TermsOfService string   // term of service information for the Swagger documentation\n}\n```\n\n```go\nsw := swagno.New(swagno.Config{Title: \"Testing API\", Version: \"v1.0.0\", Host: \"localhost:8080\"}) // optionally you can also use the License and Info properties as well\n```\n\n## Endpoints (API)\n\nDefinition:\n\n```go\ntype EndPoint struct {\n method            string\n path              string\n params            []*parameter.Parameter\n tags              []string\n Body              interface{}\n successfulReturns []response.Info\n errors            []response.Info\n description       string\n summary           string\n consume           []mime.MIME\n produce           []mime.MIME\n security          []map[string][]string\n}\n```\n\nYou need to create an Endpoint array []Endpoint and add your endpoints in this array. Example:\n\n```go\nimport \"github.com/go-swagno/swagno/components/endpoint\"\n\nendpoints := []*endpoint.EndPoint{\n  endpoint.New(\n    endpoint.POST,\n    \"/product\",\n    endpoint.WithTags(\"product\"),\n    endpoint.WithBody(models.ProductPost{}),\n    endpoint.WithSuccessfulReturns([]response.Info{models.SuccessfulResponse{}}),\n    endpoint.WithErrors([]response.Info{models.UnsuccessfulResponse{}}),\n    endpoint.WithProduce([]mime.MIME{mime.JSON, mime.XML}),\n  ),\n}\n// add endpoints array to Swagno\nsw.AddEndpoints(endpoints)\n```\n\n**Note:** You can simply add only one endpoint by using `AddEndpoint(endpoint)`\n\n### Endpoint Options\n\nArguments: The `EndPoint` object is configured via the `With\u003cproperty\u003e` functional options provided in the `github.com/go-swagno/swagno/components/endpoint package`\n\n| Function                                                    | Description                                                                                            |\n| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |\n| `WithParams(params []*parameter.Parameter)`                 | Adds parameters to the `EndPoint`.                                                                     |\n| `WithTags(tags ...string)`                                  | Assigns tags to the `EndPoint` for grouping and categorization.                                        |\n| `WithBody(body interface{})`                                | Sets the request body structure expected by the `EndPoint`.                                            |\n| `WithSuccessfulReturns(successfulReturns ...response.Info)` | Sets the successful responses from the `EndPoint`. Needs to implement the `response.Info` interface    |\n| `WithErrors(errors ...response.Info)`                       | Sets the error responses the `EndPoint` could return. Needs to implement the `response.Info` interface |\n| `WithDescription(description string)`                       | Provides a detailed description of what the `EndPoint` does.                                           |\n| `WithSummary(summary string)`                               | Gives a brief summary of the `EndPoint` purpose.                                                       |\n| `WithConsume(consume ...mime.MIME)`                         | Sets the MIME types the `EndPoint` can consume (input formats).                                        |\n| `WithProduce(produce ...mime.MIME)`                         | Sets the MIME types the `EndPoint` can produce (output formats).                                       |\n| `WithSecurity(security ...map[string][]string)`             | Sets security requirements for the `EndPoint`, such as required scopes or auth methods.                |\n\n❗ **Don't forget to add your endpoints array to Swagno prior to serving requests** ❗\n\n```go\nsw.AddEndpoints(endpoints)\n```\n\n### Parameters\n\nYou can use `endpoint.WithParams()` function to generate params array for an `Endpoint` object:\n\n```go\n// path should be -\u003e /product/{merchant}/{id}\nendpoint.WithParams(\n  parameter.StrParam(\"id\", parameter.WithIn(parameter.Path), parameter.WithRequired()),\n  parameter.StrParam(\"merchant\", parameter.WithIn(parameter.Path), parameter.WithRequired()),\n),\n```\n\n### Parameter Location\n\nEach parameter value can be assigned to a different location for the api request (i.e. [query, header, path, form]) using `WithIn`\n\n```go\nparameter.WithIn(parameter.Query)\n```\n\n| Location Type | Description                                                       |\n| ------------- | ----------------------------------------------------------------- |\n| `Query`       | Used for parameters in the URL query string.                      |\n| `Header`      | Used for parameters in the HTTP header.                           |\n| `Path`        | Used for parameters within the path of the URL.                   |\n| `Form`        | Used for parameters submitted through form data in POST requests. |\n\n#### Parameter Types\n\nBelow are all the parameter types that the `EndPoint object can take as input`\n\n| Function Signature                                                                    | Description                                                                                             |\n| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |\n| `func IntParam(name string, l Location, opts ...Option) *Parameter`                   | Creates an integer parameter with a specified name and location, accepting additional options.          |\n| `func StrParam(name string, l Location, opts ...Option) *Parameter`                   | Creates a string parameter with the given name and location, also taking variable options.              |\n| `func BoolParam(name string, l Location, opts ...Option) *Parameter`                  | Constructs a boolean parameter identified by name and location, allowing extra options to be passed.    |\n| `func FileParam(name string, opts ...Option) *Parameter`                              | Generates a file parameter using the provided name and options, typically used for file uploads.        |\n| `func IntEnumParam(name string, l Location, arr []int64, opts ...Option) *Parameter`  | Creates an integer parameter that allows a set of enumerated values, specified by the array `arr`.      |\n| `func StrEnumParam(name string, l Location, arr []string, opts ...Option) *Parameter` | Produces a string parameter with a restricted set of possible values defined by the string array `arr`. |\n| `func IntArrParam(name string, l Location, arr []int64, opts ...Option) *Parameter`   | Establishes an integer array parameter, where the array represents multiple values for the parameter.   |\n\n### Parameter Options\n\nJust like the `endpoint` package, the `parameter` package also comes with a set of functional `With\u003cOption\u003e` options to configure a parameter.\n\n| Modifier Function                          | Description                                                        |\n| ------------------------------------------ | ------------------------------------------------------------------ |\n| `WithType(t ParamType)`                    | Sets the type of a parameter (integer, string, boolean, and etc.). |\n| `WithIn(in Location)`                      | Defines where the parameter is expected (query, header).           |\n| `WithRequired()`                           | Makes the parameter required.                                      |\n| `WithDescription(description string)`      | Provides a description for the parameter.                          |\n| `WithDefault(defaultValue interface{})`    | Sets a default value for the parameter.                            |\n| `WithFormat(format string)`                | Sets the format field for the parameter.                           |\n| `WithMin(min int)`                         | sets the Min field of a Parameter.                                 |\n| `WithMax(max int)`                         | sets the Max field of a Parameter.                                 |\n| `WithMinLen(minLen int)`                   | sets the MinLen field of a Parameter.                              |\n| `WithMaxLen(maxLen int)`                   | sets the MaxLen field of a Parameter.                              |\n| `WithPattern(pattern string)`              | sets the Pattern field of a Parameter.                             |\n| `WithMaxItems(maxItems int)`               | sets the WithMaxItems field of a Parameter.                        |\n| `WithMinItems(minItems int)`               | sets the WithMinItems field of a Parameter.                        |\n| `WithUniqueItems(uniqueItems bool)`        | Sets the WithUniqueItems filed of a Parameter                      |\n| `WithMultipleOf(multipleOf int64)`         | Sets the WithMultipleOf filed of a Parameter                       |\n| `WithCollectionFormat(c CollectionFormat)` | Sets the WithCollectionFormat filed of a Parameter                 |\n\n## Defining Models\n\nThe `response.New()` function allows for creating custom response models with a flexible data structure (model any), an associated return code, and a descriptive message, enabling tailored responses for successful outcomes and error cases in an API endpoint configuration.\n\n```go\npackage response\n\nfunc response.New(model any, returnCode string, description string) CustomResponse\n```\n\nExample shown below\n\n```go\npackage response\n\n[]*endpoint.EndPoint{\n  endpoint.New(\n    ...\n    endpoint.WithSuccessfulReturns([]response.Response{response.New(models.SuccessfulResponse{}, \"Request Accepted\", \"201\")}),\n    endpoint.WithErrors([]response.Response{response.New(models.UnsuccessfulResponse{}, \"Bad Request\", \"400\")}),\n    ...\n  )\n}\n```\n\nIf you want to avoid using the helper function above you can pass in any struct as long as it's implements the `Response` interface shown below.\n\n```go\npackage response\n\n// Response is an interface for response information.\ntype Response interface {\n  Description() string\n  ReturnCode() string\n}\n```\n\n### Successful Response/Return\n\nuse a struct model instance like `models.EmptySuccessfulResponse{}` or nil\n\n### Error Response\n\nuse a struct model instance like `models.UnsuccessfulResponse{}` or nil\n\n### Request Body\n\nuse a struct model instance like `models.PostBody{}` or nil\n\n### Security (optional)\n\nAlso provides functions to set different security configurations for swagger doc\n\n```go\nsw.SetBasicAuth()\nsw.SetApiKeyAuth(\"api_key\", \"query\")\nsw.SetOAuth2Auth(\"oauth2_name\", \"password\", \"http://localhost:8080/oauth2/token\", \"http://localhost:8080/oauth2/authorize\", security.Scopes(security.Scope(\"read:pets\", \"read your pets\"), security.Scope(\"write:pets\", \"modify pets in your account\")))\n```\n\n### Required Fields\n\nnon-pointer fields will be shown in swagger model as required. In addition, fields with `omitempty` tag will **not** be required by default. If you want to add required to a field you can add struct tag as `required:\"true\"`.\n\n```go\ntype Model struct {\n  Foo  uint64       `json:\"foo\"`\n  Baz  uint64       `json:\"foo,omitempty\" required:\"true\"`\n  Boo  *string      `json:\"boo\" required:\"true\"`\n  Bar  interface{}  `json:\"bar\" required:\"true\"`\n}\n```\n\n# Contribution\n\nWe are welcome to any contribution. Swagno still has some missing features. Also we want to enrich handler implementations for other web frameworks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-swagno%2Fswagno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-swagno%2Fswagno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-swagno%2Fswagno/lists"}