{"id":13565375,"url":"https://github.com/lusoalex/vertx-jolt","last_synced_at":"2025-06-26T01:03:34.334Z","repository":{"id":52452806,"uuid":"75652862","full_name":"lusoalex/vertx-jolt","owner":"lusoalex","description":"vertx jolt facade","archived":false,"fork":false,"pushed_at":"2021-04-28T21:46:30.000Z","size":21,"stargazers_count":4,"open_issues_count":8,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T13:43:27.991Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/lusoalex.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-12-05T18:11:35.000Z","updated_at":"2023-04-12T07:18:01.000Z","dependencies_parsed_at":"2022-08-18T18:04:04.274Z","dependency_job_id":null,"html_url":"https://github.com/lusoalex/vertx-jolt","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lusoalex/vertx-jolt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lusoalex%2Fvertx-jolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lusoalex%2Fvertx-jolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lusoalex%2Fvertx-jolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lusoalex%2Fvertx-jolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lusoalex","download_url":"https://codeload.github.com/lusoalex/vertx-jolt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lusoalex%2Fvertx-jolt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261978910,"owners_count":23239417,"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-08-01T13:01:45.736Z","updated_at":"2025-06-26T01:03:34.302Z","avatar_url":"https://github.com/lusoalex.png","language":"Java","funding_links":[],"categories":["Utilities","Java"],"sub_categories":[],"readme":"# vertx-jolt\n\nThis project is a simple facade to original jolt project : https://github.com/bazaarvoice/jolt.\n***JOLT project is a json to json transformation tool.***\n\nIt works like a proxy to original jolt objects, by providing exactly the same class names \u0026 methods, but requiring Vert.x JsonObject instead of Map \u0026#60;String,Object\u0026#62;\n\nThat way we do not need to perform transformation in our business code.\n\nWithout vertx-jolt :\n\u003cpre\u003e\u003ccode\u003e\nJsonArray joltJsonSpecs = this.readJsonToJsonSettings();\nChainr chainedRules = new ChainrBuilder(joltJsonSpecs.getList()).build();\nMap \u0026#60;String,Object\u0026#62; transformedResult = (Map \u0026#60;String,Object\u0026#62;) chainedRules.transform(originalJson.toMap());\nreturn new JsonObject(transformedResult);\n\u003c/code\u003e\u003c/pre\u003e\n\nWit vertx-jolt :\n\u003cpre\u003e\u003ccode\u003e\nJsonArray joltJsonSpecs = this.readJsonToJsonSettings();\nChainr chainedRules = new ChainrBuilder(joltJsonSpecs).build();\nJsonObject transformedResult = chainedRules.transform(originalJson);\nreturn transformedResult;\n\u003c/code\u003e\u003c/pre\u003e\n\nHere we will take as example an input JSON to transform (originalJson input above) :\n```json\n{\n\t\"content\": [\n\t\t{\n\t\t\t\"name\": \"Elysee\",\n\t\t\t\"country\": \"FRANCE\",\n\t\t\t\"address\": \"Avenue des Champs-Élysées\",\n\t\t\t\"city\": \"PARIS\",\n\t\t\t\"stores_id\": 1,\n\t\t\t\"zip_code\": \"75000\",\n\t\t\t\"gps_x\": \"48.869729\",\n\t\t\t\"gps_y\": \"2.307784\",\n\t\t\t\"phone_number\": \"+33 1 00 00 00 00\",\n\t\t\t\"backend_url\": \"https://north-europe.company.com/\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Belem\",\n\t\t\t\"country\": \"PORTUGAL\",\n\t\t\t\"address\": \"Avenida Brasilia\",\n\t\t\t\"city\": \"LISBON\",\n\t\t\t\"stores_id\": 2,\n\t\t\t\"zip_code\": \"75000\",\n\t\t\t\"gps_x\": \"38.693060\",\n\t\t\t\"gps_y\": \"-9.218120\",\n\t\t\t\"phone_number\": \"+351 000 000 000\",\n\t\t\t\"backend_url\": \"https://south-europe.company.com/\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Yu garden\",\n\t\t\t\"country\": \"CHINA\",\n\t\t\t\"address\": \"huanpu qu\",\n\t\t\t\"city\": \"Shanghai\",\n\t\t\t\"stores_id\": 3,\n\t\t\t\"zip_code\": \"XXXX\",\n\t\t\t\"gps_x\": \"31.227208\",\n\t\t\t\"gps_y\": \"121.491836\",\n\t\t\t\"phone_number\": \"+86 000 000 000\",\n\t\t\t\"backend_url\": \"https://south-asia.company.com/\"\n\t\t}\n\t]\n}\n```\n\nAnd the expected JSON result is a key value json (kind of UDDI) :\n```json\n[ \n  {\n    \"key\" : 1,\n    \"value\" : \"https://north-europe.company.com/\"\n  }, \n  {\n    \"key\" : 2,\n    \"value\" : \"https://south-europe.company.com/\"\n  }, \n  {\n    \"key\" : 3,\n    \"value\" : \"https://south-asia.company.com/\"\n  } \n]\n```\n\nTo Achieve this, we need to provide a JOLT JSON specification, in our case it will be :\n```json\n[\n  {\n    \"operation\": \"shift\",\n    \"spec\": {\n      \"content\": {\n        \"*\": {\n          \"stores_id\": \"[\u00261].key\",\n          \"backend_url\": \"[\u00261].value\"\n        }\n      }\n    }\n  }\n]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flusoalex%2Fvertx-jolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flusoalex%2Fvertx-jolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flusoalex%2Fvertx-jolt/lists"}