{"id":37891394,"url":"https://github.com/go-openapi/strfmt","last_synced_at":"2026-05-31T09:02:10.062Z","repository":{"id":44597888,"uuid":"56425027","full_name":"go-openapi/strfmt","owner":"go-openapi","description":"openapi toolkit common string formats","archived":false,"fork":false,"pushed_at":"2026-05-30T18:15:52.000Z","size":557,"stargazers_count":111,"open_issues_count":7,"forks_count":66,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-05-30T20:10:35.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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":null,"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":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2016-04-17T07:44:41.000Z","updated_at":"2026-05-30T18:15:56.000Z","dependencies_parsed_at":"2024-04-26T14:28:56.531Z","dependency_job_id":"fca726c4-d5ef-4728-b96d-47c8c4399aa8","html_url":"https://github.com/go-openapi/strfmt","commit_stats":{"total_commits":150,"total_committers":44,"mean_commits":3.409090909090909,"dds":0.7133333333333334,"last_synced_commit":"1adcaa24013b6a35a8fc783547848a893dda4f1d"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/go-openapi/strfmt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-openapi%2Fstrfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-openapi%2Fstrfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-openapi%2Fstrfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-openapi%2Fstrfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-openapi","download_url":"https://codeload.github.com/go-openapi/strfmt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-openapi%2Fstrfmt/sbom","scorecard":{"id":432273,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-openapi/strfmt","commit":"1613dfcb44995eed73fd885b99b20f943dc328e5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.1,"checks":[{"name":"Maintained","score":9,"reason":"11 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":4,"reason":"Found 5/12 approved changesets -- score normalized to 4","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":"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":"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":"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/strfmt/auto-merge.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/strfmt/go-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-test.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/strfmt/go-test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go-test.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/strfmt/go-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-test.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/strfmt/go-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-test.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/strfmt/go-test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go-test.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/go-openapi/strfmt/go-test.yml/master?enable=pin","Info:   0 out of   4 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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 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"}}]},"last_synced_at":"2025-08-19T03:39:15.436Z","repository_id":44597888,"created_at":"2025-08-19T03:39:15.436Z","updated_at":"2025-08-19T03:39:15.436Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33725060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2026-01-16T16:56:39.202Z","updated_at":"2026-05-31T09:02:10.045Z","avatar_url":"https://github.com/go-openapi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# strfmt\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\nGolang support for string formats defined by JSON Schema and OpenAPI.\n\n## Announcements\n\n* **2026-03-07** : v0.26.0 **dropped dependency to the mongodb driver**\n  * mongodb users can still use this package without any change\n  * however, we have frozen the back-compatible support for mongodb driver at v2.5.0\n  * users who want to keep-up with future evolutions (possibly incompatible) of this driver\n    can do so by adding a blank import in their program: `import _ \"github.com/go-openapi/strfmt/enable/mongodb\"`.\n    This will switch the behavior to the actual driver, which remains regularly updated as an independent module.\n\n## Status\n\nAPI is stable.\n\n## Import this library in your project\n\n```cmd\ngo get github.com/go-openapi/strfmt\n```\n\n## Contents\n\nThis package exposes a registry of data types to support string formats in the go-openapi toolkit.\n\n`strfmt` represents a well known string format such as hostname or email.\n\nThis package provides a few extra formats such as credit card (US), color, etc.\n\nFormat types can serialize and deserialize JSON or from a SQL database.\n\nBSON is also supported (MongoDB).\n\n### Supported formats\n\n`go-openapi/strfmt` follows the swagger 2.0 specification with the following formats\ndefined [here](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types).\n\nIt also provides convenient extensions to go-openapi users.\n\n- [x] JSON-schema draft 4 formats\n  - date-time\n  - email\n  - hostname\n  - ipv4\n  - ipv6\n  - uri\n- [x] swagger 2.0 format extensions\n  - binary\n  - byte (e.g. base64 encoded string)\n  - date (e.g. \"1970-01-01\")\n  - password\n- [x] go-openapi custom format extensions\n  - bsonobjectid (BSON objectID)\n  - creditcard\n  - duration (e.g. \"3 weeks\", \"1ms\")\n  - hexcolor (e.g. \"#FFFFFF\")\n  - isbn, isbn10, isbn13\n  - mac (e.g \"01:02:03:04:05:06\")\n  - rgbcolor (e.g. \"rgb(100,100,100)\")\n  - ssn\n  - uuid, uuid3, uuid4, uuid5, uuid7\n  - cidr (e.g. \"192.0.2.1/24\", \"2001:db8:a0b:12f0::1/32\")\n  - ulid (e.g. \"00000PP9HGSBSSDZ1JTEXBJ0PW\", [spec](https://github.com/ulid/spec))\n\n\u003e NOTE: as the name stands for, this package is intended to support string formatting only.\n\u003e It does not provide validation for numerical values with swagger format extension for JSON types \"number\" or\n\u003e \"integer\" (e.g. float, double, int32...).\n\n### Type conversion\n\nAll types defined here are stringers and may be converted to strings with `.String()`.\nNote that most types defined by this package may be converted directly to string like `string(Email{})`.\n\n`Date` and `DateTime` may be converted directly to `time.Time` like `time.Time(Time{})`.\nSimilarly, you can convert `Duration` to `time.Duration` as in `time.Duration(Duration{})`\n\n### Using pointers\n\nThe `conv` subpackage provides helpers to convert the types to and from pointers, just like `go-openapi/swag` does\nwith primitive types.\n\n### Format types\n\nTypes defined in `strfmt` expose marshaling and validation capabilities.\n\nList of defined types:\n- Base64\n- CreditCard\n- Date\n- DateTime\n- Duration\n- Email\n- HexColor\n- Hostname\n- IPv4\n- IPv6\n- CIDR\n- ISBN\n- ISBN10\n- ISBN13\n- MAC\n- ObjectId\n- Password\n- RGBColor\n- SSN\n- URI\n- UUID\n- [UUID3](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-3)\n- [UUID4](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-4)\n- [UUID5](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-5)\n- [UUID7](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7)\n- [ULID](https://github.com/ulid/spec)\n\n### Database support\n\nAll format types implement the `database/sql` interfaces `sql.Scanner` and `driver.Valuer`,\nso they work out of the box with Go's standard `database/sql` package and any SQL driver.\n\nAll format types also implement BSON marshaling/unmarshaling for use with MongoDB.\nBy default, a built-in minimal codec is used (compatible with mongo-driver v2.5.0).\nFor full driver support, add `import _ \"github.com/go-openapi/strfmt/enable/mongodb\"`.\n\n\u003e **MySQL / MariaDB caveat for `DateTime`:**\n\u003e The `go-sql-driver/mysql` driver has hard-coded handling for `time.Time` but does not\n\u003e intercept type redefinitions like `strfmt.DateTime`. As a result, `DateTime.Value()` sends\n\u003e an RFC 3339 string (e.g. `\"2024-06-15T12:30:45.123Z\"`) that MySQL/MariaDB rejects for\n\u003e `DATETIME` columns.\n\u003e\n\u003e Workaround: set `strfmt.MarshalFormat` to a MySQL-compatible format such as\n\u003e `strfmt.ISO8601LocalTime` and normalize to UTC before marshaling:\n\u003e\n\u003e ```go\n\u003e strfmt.MarshalFormat = strfmt.ISO8601LocalTime\n\u003e strfmt.NormalizeTimeForMarshal = func(t time.Time) time.Time { return t.UTC() }\n\u003e ```\n\u003e\n\u003e See [#174](https://github.com/go-openapi/strfmt/issues/174) for details.\n\nIntegration tests for MongoDB, MariaDB, and PostgreSQL run in CI to verify database roundtrip\ncompatibility for all format types. See [`internal/testintegration/`](internal/testintegration/).\n\n## Change log\n\nSee \u003chttps://github.com/go-openapi/strfmt/releases\u003e\n\n## References\n\n\u003chttps://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md\u003e\n\n## Licensing\n\nThis library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE).\n\n## Other documentation\n\n* [All-time contributors](./CONTRIBUTORS.md)\n* [Contributing guidelines][contributing-doc-site]\n* [Maintainers documentation][maintainers-doc-site]\n* [Code style][style-doc-site]\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/strfmt/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/strfmt/actions/workflows/go-test.yml/badge.svg\n[test-url]: https://github.com/go-openapi/strfmt/actions/workflows/go-test.yml\n[cov-badge]: https://codecov.io/gh/go-openapi/strfmt/branch/master/graph/badge.svg\n[cov-url]: https://codecov.io/gh/go-openapi/strfmt\n[vuln-scan-badge]: https://github.com/go-openapi/strfmt/actions/workflows/scanner.yml/badge.svg\n[vuln-scan-url]: https://github.com/go-openapi/strfmt/actions/workflows/scanner.yml\n[codeql-badge]: https://github.com/go-openapi/strfmt/actions/workflows/codeql.yml/badge.svg\n[codeql-url]: https://github.com/go-openapi/strfmt/actions/workflows/codeql.yml\n\u003c!-- Badges: release \u0026 docker images  --\u003e\n[release-badge]: https://badge.fury.io/gh/go-openapi%2Fstrfmt.svg\n[release-url]: https://badge.fury.io/gh/go-openapi%2Fstrfmt\n[gomod-badge]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fstrfmt.svg\n[gomod-url]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fstrfmt\n\u003c!-- Badges: code quality  --\u003e\n[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/strfmt\n[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/strfmt\n[codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/strfmt\n[codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/strfmt\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/strfmt\n[godoc-url]: http://pkg.go.dev/github.com/go-openapi/strfmt\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/strfmt/?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/strfmt\n[goversion-url]: https://github.com/go-openapi/strfmt/blob/master/go.mod\n[top-badge]: https://img.shields.io/github/languages/top/go-openapi/strfmt\n[commits-badge]: https://img.shields.io/github/commits-since/go-openapi/strfmt/latest\n\u003c!-- Organization docs --\u003e\n[contributing-doc-site]: https://go-openapi.github.io/doc-site/contributing/contributing/index.html\n[maintainers-doc-site]: https://go-openapi.github.io/doc-site/maintainers/index.html\n[style-doc-site]: https://go-openapi.github.io/doc-site/contributing/style/index.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-openapi%2Fstrfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-openapi%2Fstrfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-openapi%2Fstrfmt/lists"}