{"id":17729308,"url":"https://github.com/opwvhk/avro-conversions","last_synced_at":"2025-08-11T20:31:48.429Z","repository":{"id":154915135,"uuid":"630889943","full_name":"opwvhk/avro-conversions","owner":"opwvhk","description":"Parse JSON, XML, ... into Avro objects - including Avro-like schema resolution","archived":false,"fork":false,"pushed_at":"2024-08-18T05:53:11.000Z","size":610,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-18T06:46:53.111Z","etag":null,"topics":["avro","json-parser","json-schema","xml-parser","xsd"],"latest_commit_sha":null,"homepage":"https://central.sonatype.com/artifact/net.sf.opk/avro-conversions/overview","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/opwvhk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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}},"created_at":"2023-04-21T11:48:49.000Z","updated_at":"2024-08-18T05:53:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"e39625a1-0d7b-4825-8eb4-e3d6f327fb85","html_url":"https://github.com/opwvhk/avro-conversions","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opwvhk%2Favro-conversions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opwvhk%2Favro-conversions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opwvhk%2Favro-conversions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opwvhk%2Favro-conversions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opwvhk","download_url":"https://codeload.github.com/opwvhk/avro-conversions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229602098,"owners_count":18097014,"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":["avro","json-parser","json-schema","xml-parser","xsd"],"created_at":"2024-10-25T21:06:24.246Z","updated_at":"2024-12-13T19:13:55.545Z","avatar_url":"https://github.com/opwvhk.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/opwvhk/avro-conversions/workflows/Maven%20Build/badge.svg)](https://github.com/opwvhk/avro-conversions/actions/workflows/maven.yml)\n[![License](https://img.shields.io/github/license/opwvhk/avro-conversions?color=brightgreen)](https://www.apache.org/licenses/LICENSE-2.0.html)\n[![Maven Central Version](https://img.shields.io/maven-central/v/net.sf.opk/avro-conversions?color=brightgreen)](https://maven-badges.herokuapp.com/maven-central/net.sf.opk/avro-conversions)\n\nAvro Conversions\n================\n\nProvides parsers to read various formats as Avro records (currently JSON and XML), as well as tools\nto manipulate and/or describe schemas. The latter includes the conversion of XML Schema definitions\n(XSD) and JSON Schema into Avro schemas.\n\n\nDocumentation\n-------------\n\nThe documentation is split into two parts. The impatient among us can start with the \"Quickstart\"\nsection below. For the others, there is [more elaborate documentation](doc/index.md).\n\n\nQuickstart\n----------\n\nWant to jump right in? Here's a simple example to read a JSON schema, manipulate in into an Avro\nschema, and then parse a JSON file into the (different) Avro records:\n\n```java\nimport opwvhk.avro.SchemaManipulator;\nimport opwvhk.avro.json.JsonAsAvroParser;\nimport opwvhk.avro.util.NamingConvention;\nimport org.apache.avro.Schema;\nimport org.apache.avro.generic.GenericRecord;\n\nclass Example {\n  public static void main(String[] args) throws Exception {\n    // Expected are 2 arguments:\n    // * the location of a JSON schema file\n    // * the location of a JSON file\n    URL jsonSchemaLocation = new URL(args[0]);\n    URL jsonFileLocation = new URL(args[1]);\n\n    StringBuilder buffer = new StringBuilder();\n    // Read an Avro schema; other methods can convert an XSD or JSON schema.\n    Schema readSchema = SchemaManipulator.startFromJsonSchema(jsonSchemaLocation)\n        .useSchemaNamingConvention(NamingConvention.PASCAL_CASE)\n        .useFieldNamingConvention(NamingConvention.CAMEL_CASE)\n        .renameField(\"newName\", \"path\", \"to\", \"field\")\n        .renameSchema(\"OldName\", \"NewName\")\n        .alsoDocumentAsMarkdownTable(buffer)\n        .finish();\n    // Print the schema as a Markdown table\n    System.out.println(buffer);\n\n    // Create a parser that reads JSON, validated according to the JSON schema, into Avro\n    // records using a read schema.\n    GenericData model = GenericData.get();\n    JsonAsAvroParser parser = new JsonAsAvroParser(jsonSchemaLocation, readSchema, model);\n\n    // The record type depends on the class generated by GenericData.get() (you can also use SpecificData or ReflectiveData).\n    GenericRecord record = parser.parse(jsonFileLocation);\n    System.out.println(record);\n  }\n}\n```\n\n\nUpgrade notes\n-------------\n\n### From 1.x to 2.x\n\n1. XML validation has been changed. Previously you could choose whether to validate per input. Now,\n   whether inputs will be validated is a fixed setting per parser instance. See the constructor\n   parameters for details.\n2. Constructing a JSON parser can no longer throw a (library specific) `GenerationException`; this\n   has become a runtime exception instead.\n\n### From 2.x to 3.x\n\n1. Logging has changed: the library now uses the Java 9 Platform Logger\n   (see [Logging](#logging) below)\n\n\nLogging\n-------\n\nThis library uses the Java 9 Platform Logger (`System.Logger`) functionality, which is the new\nstandard for libraries (it is a zero-dependency option allowing you to plug in your own logging\nframework). Dependencies however, are known to use SLF4J and Java Commons Logging (JCL).\n\n### Example configuration using Log4J\n\nTo log via Log4J, add these dependencies and configure Log4J:\n\n* `org.apache.logging.log4j:log4j-jpl`\n* `org.apache.logging.log4j:log4j-slf4j2-impl`\n* `org.apache.logging.log4j:log4j-core`\n\nJCL defers to Log4J if available (a builtin feature), and the dependencies add Log4J itself and\nautoconfigure the JDK and SLF4J to use Log4J.\n\n### Example configuration using Logback\n\nTo log via Logback, configure Log4J and add these dependencies:\n\n* `org.slf4j:slf4j-jdk-platform-logging`\n* `ch.qos.logback:logback-classic`\n\nJCL defers to SLF4J if available (a builtin feature), and the dependencies add Logback (which\nnatively supports SLF4J) and autoconfigure the JDK to use SLF4J.\n\n\nContributing ✨\n---------------\n\n\u003c!--\nTODO: uncomment when there are multiple committers\nA special thank you to all who contributed! All contributions are sincerely appreciated.\n\n[![Contributors](https://contrib.rocks/image?repo=opwvhk/avro-conversions)](https://github.com/opwvhk/avro-conversions/graphs/contributors)\n--\u003e\n\nAre you interested in contributing? These links may be of interest:\n\n* [Contributing Guidelines](CONTRIBUTING.md)\n* [Good First Issues](https://github.com/opwvhk/avro-conversions/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopwvhk%2Favro-conversions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopwvhk%2Favro-conversions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopwvhk%2Favro-conversions/lists"}