{"id":21658349,"url":"https://github.com/go-openapi/swag","last_synced_at":"2026-04-15T19:00:48.825Z","repository":{"id":44667344,"uuid":"56420035","full_name":"go-openapi/swag","owner":"go-openapi","description":"goodie bag in use in the go-openapi projects","archived":false,"fork":false,"pushed_at":"2026-04-15T17:28:40.000Z","size":1119,"stargazers_count":219,"open_issues_count":2,"forks_count":51,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-04-15T17:29:50.221Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-openapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"docs/MAINTAINERS.md","copyright":null,"agents":"AGENTS.md","dco":".github/DCO.md","cla":null}},"created_at":"2016-04-17T05:10:16.000Z","updated_at":"2026-04-15T15:38:21.000Z","dependencies_parsed_at":"2024-02-01T09:44:25.270Z","dependency_job_id":"f334d15e-fe29-47da-bf77-0607e9c5d66b","html_url":"https://github.com/go-openapi/swag","commit_stats":null,"previous_names":[],"tags_count":146,"template":false,"template_full_name":null,"purl":"pkg:github/go-openapi/swag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-openapi%2Fswag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-openapi%2Fswag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-openapi%2Fswag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-openapi%2Fswag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-openapi","download_url":"https://codeload.github.com/go-openapi/swag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-openapi%2Fswag/sbom","scorecard":{"id":432274,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-openapi/swag","commit":"148ce5379af50e48584dfbdd6533b6ae35ae7546"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/22 approved changesets -- score normalized to 0","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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: topLevel 'contents' permission set to 'write': .github/workflows/auto-merge.yml:5","Warn: no topLevel permission defined: .github/workflows/go-test.yml:1","Info: no jobLevel write permissions found"],"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":"Maintained","score":1,"reason":"2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1","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":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/auto-merge.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/swag/auto-merge.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-test.yml:103: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/swag/go-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-test.yml:109: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/swag/go-test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go-test.yml:120: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/swag/go-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/swag/go-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-test.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/swag/go-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-test.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/swag/go-test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go-test.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/swag/go-test.yml/master?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"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":"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: Apache License 2.0: 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":1,"reason":"SAST tool is not run on all commits -- score normalized to 1","details":["Warn: 4 commits out of 30 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":10,"reason":"0 existing vulnerabilities detected","details":null,"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:39:16.899Z","repository_id":44667344,"created_at":"2025-08-19T03:39:16.899Z","updated_at":"2025-08-19T03:39:16.899Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31855432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"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":[],"created_at":"2024-11-25T09:29:07.958Z","updated_at":"2026-04-15T19:00:48.818Z","avatar_url":"https://github.com/go-openapi.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Swag\n\n\u003c!-- Badges: status  --\u003e\n[![Tests][test-badge]][test-url] [![Coverage][cov-badge]][cov-url] [![CI vuln scan][vuln-scan-badge]][vuln-scan-url] [![CodeQL][codeql-badge]][codeql-url]\n\u003c!-- Badges: release \u0026 docker images  --\u003e\n\u003c!-- Badges: code quality  --\u003e\n\u003c!-- Badges: license \u0026 compliance --\u003e\n[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url]\n\u003c!-- Badges: documentation \u0026 support --\u003e\n\u003c!-- Badges: others \u0026 stats --\u003e\n[![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge]\n\n---\n\nA bunch of helper functions for go-openapi and go-swagger projects.\n\nYou may also use it standalone for your projects.\n\n\u003e **NOTE**\n\u003e `swag` is one of the foundational building blocks of the go-openapi initiative.\n\u003e\n\u003e Most repositories in `github.com/go-openapi/...` depend on it in some way.\n\u003e And so does our CLI tool `github.com/go-swagger/go-swagger`,\n\u003e as well as the code generated by this tool.\n\n* [Contents](#contents)\n* [Dependencies](#dependencies)\n* [Change log](#change-log)\n* [Licensing](#licensing)\n* [Note to contributors](#note-to-contributors)\n* [Roadmap](#roadmap)\n\n## Announcements\n\n* **2025-12-19** : new community chat on discord\n  * a new discord community channel is available to be notified of changes and support users\n  * our venerable Slack channel remains open, and will be eventually discontinued on **2026-03-31**\n\nYou may join the discord community by clicking the invite link on the discord badge (also above). [![Discord Channel][discord-badge]][discord-url]\n\nOr join our Slack channel: [![Slack Channel][slack-logo]![slack-badge]][slack-url]\n\n## Status\n\nAPI is stable.\n\n## Import this library in your project\n\n```cmd\ngo get github.com/go-openapi/swag/{module}\n```\n\nOr for backward compatibility:\n\n```cmd\ngo get github.com/go-openapi/swag\n```\n\n## Contents\n\n`go-openapi/swag` exposes a collection of relatively independent modules.\n\nMoving forward, no additional feature will be added to the `swag` API directly at the root package level,\nwhich remains there for backward-compatibility purposes. All exported top-level features are now deprecated.\n\nChild modules will continue to evolve and some new ones may be added in the future.\n\n| Module        | Content | Main features |\n|---------------|---------|---------------|\n| `cmdutils`     | utilities to work with CLIs ||\n| `conv`        | type conversion utilities | convert between values and pointers for any types\u003cbr /\u003econvert from string to builtin types (wraps `strconv`)\u003cbr /\u003erequire `./typeutils` (test dependency)\u003cbr /\u003e |\n| `fileutils`   | file utilities | |\n| `jsonname`    | JSON utilities | infer JSON names from `go` properties\u003cbr /\u003e |\n| `jsonutils`   | JSON utilities | fast json concatenation\u003cbr /\u003eread and write JSON from and to dynamic `go` data structures\u003cbr /\u003e~require `github.com/mailru/easyjson`~\u003cbr /\u003e |\n| `loading`     | file loading | load from file or http\u003cbr /\u003erequire `./yamlutils`\u003cbr /\u003e |\n| `mangling`    | safe name generation | name mangling for `go`\u003cbr /\u003e |\n| `netutils`    | networking utilities | host, port from address\u003cbr /\u003e |\n| `stringutils` | `string` utilities | search in slice (with case-insensitive)\u003cbr /\u003esplit/join query parameters as arrays\u003cbr /\u003e |\n| `typeutils`   | `go` types utilities | check the zero value for any type\u003cbr /\u003esafe check for a nil value\u003cbr /\u003e |\n| `yamlutils`   | YAML utilities | converting YAML to JSON\u003cbr /\u003eloading YAML into a dynamic YAML document\u003cbr /\u003emaintaining the original order of keys in YAML objects\u003cbr /\u003erequire `./jsonutils`\u003cbr /\u003e~require `github.com/mailru/easyjson`~\u003cbr /\u003erequire `go.yaml.in/yaml/v3`\u003cbr /\u003e |\n\n---\n\n## Dependencies\n\nThe root module `github.com/go-openapi/swag` at the repo level maintains a few\ndependencies outside of the standard library.\n\n* YAML utilities depend on `go.yaml.in/yaml/v3`\n* JSON utilities depend on their registered adapter module:\n    * by default, only the standard library is used\n    * `github.com/mailru/easyjson` is now only a dependency for module\n      `github.com/go-openapi/swag/jsonutils/adapters/easyjson/json`,\n      for users willing to import that module.\n    * integration tests and benchmarks use all the dependencies are published as their own module\n* other dependencies are test dependencies drawn from `github.com/stretchr/testify`\n\n## Usage\n\n**How to explicitly register a dependency at runtime**?\n\nThe following would maintain how JSON utilities proposed by `swag` used work, up to `v0.24.1`.\n\n  ```go\n  import (\n    \"github.com/go-openapi/swag/jsonutils/adapters\"\n    easyjson \"github.com/go-openapi/swag/jsonutils/adapters/easyjson/json\"\n  )\n\n  func init() {\n\t  easyjson.Register(adapters.Registry)\n  }\n  ```\n\nSubsequent calls to `jsonutils.ReadJSON()` or `jsonutils.WriteJSON()` will switch to `easyjson`\nwhenever the passed data structures implement the `easyjson.Unmarshaler` or `easyjson.Marshaler` respectively,\nor fallback to the standard library.\n\nFor more details, you may also look at our\n[integration tests](jsonutils/adapters/testintegration/integration_suite_test.go#29).\n\n---\n\n## Note to contributors\n\nAll kinds of contributions are welcome.\n\nThis repo is a go mono-repo. See [docs](docs/MAINTAINERS.md).\n\nMore general guidelines are available [here](.github/CONTRIBUTING.md).\n\n## Roadmap\n\nSee the current [TODO list](docs/TODOS.md)\n\n## Change log\n\nSee \u003chttps://github.com/go-openapi/swag/releases\u003e\n\nFor pre-v0.26.0 releases, see [release notes](./docs/NOTES.md).\n\n**What coming next?**\n\nMoving forward, we want to :\n\n* provide an implementation of the JSON adapter based on `encoding/json/v2`, for `go1.25` builds.\n* provide similar implementations for `goccy/go-json` and `jsoniterator/go`, and perhaps some other\n  similar libraries may be interesting too.\n\n\u003c!--\n\n## References\n\n--\u003e\n\n## Licensing\n\nThis library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE).\n\n\u003c!--\nSee the license [NOTICE](./NOTICE), which recalls the licensing terms of all the pieces of software\non top of which it has been built.\n--\u003e\n\n\u003c!--\n\n## Limitations\n\n--\u003e\n\n## Other documentation\n\n* [All-time contributors](./CONTRIBUTORS.md)\n* [Contributing guidelines](.github/CONTRIBUTING.md)\n* [Maintainers documentation](docs/MAINTAINERS.md)\n* [Code style](docs/STYLE.md)\n\n## Cutting a new release\n\nMaintainers can cut a new release by either:\n\n* running [this workflow](https://github.com/go-openapi/swag/actions/workflows/bump-release.yml)\n* or pushing a semver tag\n  * signed tags are preferred\n  * The tag message is prepended to release notes\n\n\u003c!-- Badges: status  --\u003e\n[test-badge]: https://github.com/go-openapi/swag/actions/workflows/go-test.yml/badge.svg\n[test-url]: https://github.com/go-openapi/swag/actions/workflows/go-test.yml\n[cov-badge]: https://codecov.io/gh/go-openapi/swag/branch/master/graph/badge.svg\n[cov-url]: https://codecov.io/gh/go-openapi/swag\n[vuln-scan-badge]: https://github.com/go-openapi/swag/actions/workflows/scanner.yml/badge.svg\n[vuln-scan-url]: https://github.com/go-openapi/swag/actions/workflows/scanner.yml\n[codeql-badge]: https://github.com/go-openapi/swag/actions/workflows/codeql.yml/badge.svg\n[codeql-url]: https://github.com/go-openapi/swag/actions/workflows/codeql.yml\n\u003c!-- Badges: release \u0026 docker images  --\u003e\n[release-badge]: https://badge.fury.io/gh/go-openapi%2Fswag.svg\n[release-url]: https://badge.fury.io/gh/go-openapi%2Fswag\n[gomod-badge]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fswag.svg\n[gomod-url]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fswag\n\u003c!-- Badges: code quality  --\u003e\n[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/swag\n[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/swag\n[codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/swag\n[codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/swag\n\u003c!-- Badges: documentation \u0026 support --\u003e\n[doc-badge]: https://img.shields.io/badge/doc-site-blue?link=https%3A%2F%2Fgoswagger.io%2Fgo-openapi%2F\n[doc-url]: https://goswagger.io/go-openapi\n[godoc-badge]: https://pkg.go.dev/badge/github.com/go-openapi/swag\n[godoc-url]: http://pkg.go.dev/github.com/go-openapi/swag\n[slack-logo]: https://a.slack-edge.com/e6a93c1/img/icons/favicon-32.png\n[slack-badge]: https://img.shields.io/badge/slack-blue?link=https%3A%2F%2Fgoswagger.slack.com%2Farchives%2FC04R30YM\n[slack-url]: https://goswagger.slack.com/archives/C04R30YMU\n[discord-badge]: https://img.shields.io/discord/1446918742398341256?logo=discord\u0026label=discord\u0026color=blue\n[discord-url]: https://discord.gg/FfnFYaC3k5\n\n\u003c!-- Badges: license \u0026 compliance --\u003e\n[license-badge]: http://img.shields.io/badge/license-Apache%20v2-orange.svg\n[license-url]: https://github.com/go-openapi/swag/?tab=Apache-2.0-1-ov-file#readme\n\u003c!-- Badges: others \u0026 stats --\u003e\n[goversion-badge]: https://img.shields.io/github/go-mod/go-version/go-openapi/swag\n[goversion-url]: https://github.com/go-openapi/swag/blob/master/go.mod\n[top-badge]: https://img.shields.io/github/languages/top/go-openapi/swag\n[commits-badge]: https://img.shields.io/github/commits-since/go-openapi/swag/latest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-openapi%2Fswag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-openapi%2Fswag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-openapi%2Fswag/lists"}