{"id":23261522,"url":"https://github.com/theinkedengineer/not-just-another-init-macro","last_synced_at":"2025-10-27T07:31:55.285Z","repository":{"id":191018106,"uuid":"683767378","full_name":"TheInkedEngineer/not-just-another-init-macro","owner":"TheInkedEngineer","description":"An advanced Swift macro to automatically generate an initializer","archived":false,"fork":false,"pushed_at":"2023-08-30T07:53:29.000Z","size":21,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-19T13:34:11.967Z","etag":null,"topics":["macro","package","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheInkedEngineer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-08-27T16:31:40.000Z","updated_at":"2024-09-09T11:52:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"73a5792f-bd88-4733-bc2c-84fa71a9d903","html_url":"https://github.com/TheInkedEngineer/not-just-another-init-macro","commit_stats":null,"previous_names":["theinkedengineer/swift-init-macro"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheInkedEngineer%2Fnot-just-another-init-macro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheInkedEngineer%2Fnot-just-another-init-macro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheInkedEngineer%2Fnot-just-another-init-macro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheInkedEngineer%2Fnot-just-another-init-macro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheInkedEngineer","download_url":"https://codeload.github.com/TheInkedEngineer/not-just-another-init-macro/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238462431,"owners_count":19476536,"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":["macro","package","swift"],"created_at":"2024-12-19T13:33:14.318Z","updated_at":"2025-10-27T07:31:54.992Z","avatar_url":"https://github.com/TheInkedEngineer.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Not just another Init macro\n\n`Not just another Init macro` is a Swift macro to automatically generate an initialiser for a `struct` or `class`.\nIt is supercharged with features to make it as flexible as possible.\n\n## Features\n\n- Retrieves inferred basic data types, arrays and dictionaries \n- Support for arrays and dictionaries containing nil values.\n- Support for casting.\n- Support for escaping closures.\n- Ability to generate a public or private initiliaser.\n- Ability to omit variables from the initialiser.\n- Ability to provide default values for variables in the initialiser.\n- Diagnostic messages to avoid typos, wrong access level, etc..\n\n## Usage\n\n```swift\n@Init(accessLevel: .internal, defaultValues: [\"key2\": true], exclude: [\"key4\"])\npublic struct Test {\n  let key: String\n  let key2: Bool\n  let key3: Int\n  var key4 = [\"HI\", \"Bye\"]\n  var key5 = [3, \"Int\"] as [Any]\n  var key6 = [\"key\": \"value\"]\n  var key7 = [\"key\": \"value\", \"anotherKey\": 1] as [String: Any]\n  var key8 = [\"key\": \"value\", 1: false] as [AnyHashable: Any]\n  var key9 = 3.0 as Float\n  var key10 = 3.0\n  let optionalKey: String?\n  var optionalKey2 = [3, nil]\n  var optionalKey3 = [\"key\": nil] as [String: Any?]\n  var optionalKey4 = [1: nil, 2: \"value\"]\n  var optionalKey5 = 3.0 as Float\n  var closure: (Int) -\u003e ()\n}\n```\nwill generate:\n\n```swift\ninternal init(\n    key: String,\n    key2: Bool = true,\n    key3: Int,\n    key5: [Any],\n    key6: [String: String],\n    key7: [String: Any],\n    key8: [AnyHashable: Any],\n    key9: Float,\n    key10: Double,\n    optionalKey: String?,\n    optionalKey2: [Int?],\n    optionalKey3: [String: Any?],\n    optionalKey4: [Int: String?],\n    optionalKey5: Float,\n    closure: @escaping (Int) -\u003e ()\n) {\n    self.key = key\n    self.key2 = key2\n    self.key3 = key3\n    self.key5 = key5\n    self.key6 = key6\n    self.key7 = key7\n    self.key8 = key8\n    self.key9 = key9\n    self.key10 = key10\n    self.optionalKey = optionalKey\n    self.optionalKey2 = optionalKey2\n    self.optionalKey3 = optionalKey3\n    self.optionalKey4 = optionalKey4\n    self.optionalKey5 = optionalKey5\n    self.closure = closure\n}\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheinkedengineer%2Fnot-just-another-init-macro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheinkedengineer%2Fnot-just-another-init-macro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheinkedengineer%2Fnot-just-another-init-macro/lists"}