{"id":27334295,"url":"https://github.com/nanoxd/bourne","last_synced_at":"2026-04-29T17:03:28.439Z","repository":{"id":56903929,"uuid":"68144888","full_name":"nanoxd/Bourne","owner":"nanoxd","description":"A JSON parser for backends with variant types","archived":false,"fork":false,"pushed_at":"2017-09-06T17:36:33.000Z","size":134,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-17T04:34:35.033Z","etag":null,"topics":["json","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/nanoxd.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}},"created_at":"2016-09-13T20:28:51.000Z","updated_at":"2017-08-28T20:25:09.000Z","dependencies_parsed_at":"2022-08-20T18:50:31.410Z","dependency_job_id":null,"html_url":"https://github.com/nanoxd/Bourne","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nanoxd/Bourne","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoxd%2FBourne","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoxd%2FBourne/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoxd%2FBourne/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoxd%2FBourne/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nanoxd","download_url":"https://codeload.github.com/nanoxd/Bourne/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoxd%2FBourne/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32435122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"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":["json","swift"],"created_at":"2025-04-12T14:10:13.051Z","updated_at":"2026-04-29T17:03:28.415Z","avatar_url":"https://github.com/nanoxd.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bourne\n[![Build Status](https://travis-ci.org/nanoxd/Bourne.svg?branch=master)](https://travis-ci.org/nanoxd/Bourne)\n\n## Installation\n\n### CocoaPods\n\nAdd the line `pod \"Bourne\"` to your `Podfile`\n\n### Carthage\n\nAdd the line `github \"nanoxd/Bourne\"` to your `Cartfile`\n\n### Manual\n\nClone the repo and drag the file `Bourne.swift` into your Xcode project.\n\n#### Swift Package Manager\n\nAdd the line `.Package(url: \"https://github.com/nanoxd/Bourne.git\", majorVersion: 1)` to your `Package.swift` file.\n\n## Usage\n\n### Conforming to Mappable\n\n```swift\nimport Bourne\n\nstruct Person {\n  let firstName: String\n  let lastName: String\n  let age: Int?\n}\n\nextension Person: Mappable {\n  static func decode(_ j: JSON) throws -\u003e Person {\n    return Person(\n      firstName: try j.from(\"firstName\"),\n      lastName: try j.from(\"lastName\", or: \"Medina\"),\n      age: try? j.from(\"age\")\n    )\n  }\n}\n```\n\n\n### Optional Values\n\nBourne has two ways of working with Optional values, `try?` and adding a default value to `from`.\n\nFirst, let's look at how to decode a value that is sometimes included in our JSON:\n\n```json\n{\n  \"people\": [\n    {\n      \"firstName\": \"Jose\",\n      \"lastName\": null\n    },\n    {\n      \"firstName\": \"Maria\",\n      \"lastName\": \"Sanchez\",\n      \"age\": 20\n    }\n  ]\n}\n```\n\n```swift\ntry? j.from(\"age\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanoxd%2Fbourne","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanoxd%2Fbourne","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanoxd%2Fbourne/lists"}