{"id":19540694,"url":"https://github.com/oapi-codegen/nullable","last_synced_at":"2025-05-12T18:05:07.054Z","repository":{"id":216282529,"uuid":"740892829","full_name":"oapi-codegen/nullable","owner":"oapi-codegen","description":"An implementation of a `Nullable` type for JSON bodies, indicating whether the field is absent, set to null, or set to a value","archived":false,"fork":false,"pushed_at":"2024-09-10T02:44:28.000Z","size":15,"stargazers_count":99,"open_issues_count":6,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-19T10:59:50.938Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oapi-codegen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["oapi-codegen","jamietanna"],"tidelift":"go/github.com/oapi-codegen/nullable","open_collective":"oapi-codegen"}},"created_at":"2024-01-09T09:33:36.000Z","updated_at":"2024-09-21T03:34:30.000Z","dependencies_parsed_at":"2024-04-12T09:49:56.586Z","dependency_job_id":"97a31ed6-0c38-4a64-a900-5a9a3614b7ce","html_url":"https://github.com/oapi-codegen/nullable","commit_stats":{"total_commits":8,"total_committers":4,"mean_commits":2.0,"dds":0.5,"last_synced_commit":"0d2a587518c93d9fda3b3d167d2d30bd07d4c207"},"previous_names":["oapi-codegen/nullable"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oapi-codegen%2Fnullable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oapi-codegen%2Fnullable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oapi-codegen%2Fnullable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oapi-codegen%2Fnullable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oapi-codegen","download_url":"https://codeload.github.com/oapi-codegen/nullable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243428560,"owners_count":20289341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-11T03:05:40.013Z","updated_at":"2025-03-15T08:08:32.128Z","avatar_url":"https://github.com/oapi-codegen.png","language":"Go","readme":"# oapi-codegen/nullable\n\n\u003e An implementation of a `Nullable` type for JSON bodies, indicating whether the field is absent, set to null, or set to a value\n\nUnlike other known implementations, this makes it possible to both marshal and unmarshal the value, as well as represent all three states:\n\n- the field is _not set_\n- the field is _explicitly set to null_\n- the field is _explicitly set to a given value_\n\nAnd can be embedded in structs, for instance with the following definition:\n\n```go\nobj := struct {\n\t\t// RequiredID is a required, nullable field\n\t\tRequiredID     nullable.Nullable[int]     `json:\"id\"`\n\t\t// OptionalString is an optional, nullable field\n\t\t// NOTE that no pointer is required, only `omitempty`\n\t\tOptionalString nullable.Nullable[string] `json:\"optionalString,omitempty\"`\n}{}\n```\n\n## Usage\n\n\u003e [!IMPORTANT]\n\u003e Although this project is under the [oapi-codegen org](https://github.com/oapi-codegen) for the `oapi-codegen` OpenAPI-to-Go code generator, this is intentionally released as a separate, standalone library which can be used by other projects.\n\nFirst, add to your project with:\n\n```sh\ngo get github.com/oapi-codegen/nullable\n```\n\nCheck out the examples in [the package documentation on pkg.go.dev](https://pkg.go.dev/github.com/oapi-codegen/nullable) for more details.\n\n## Credits\n\n- [KumanekoSakura](https://github.com/KumanekoSakura), [via](https://github.com/golang/go/issues/64515#issuecomment-1842973794)\n- [Sebastien Guilloux](https://github.com/sebgl), [via](https://github.com/sebgl/nullable/)\n\nAs well as contributions from:\n\n- [Jamie Tanna](https://www.jvt.me)\n- [Ashutosh Kumar](https://github.com/sonasingh46)\n\n## License\n\nLicensed under the Apache-2.0 license.\n","funding_links":["https://github.com/sponsors/oapi-codegen","https://github.com/sponsors/jamietanna","https://tidelift.com/funding/github/go/github.com/oapi-codegen/nullable","https://opencollective.com/oapi-codegen"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foapi-codegen%2Fnullable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foapi-codegen%2Fnullable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foapi-codegen%2Fnullable/lists"}