{"id":28566806,"url":"https://github.com/salsify/avro-resolution_canonical_form","last_synced_at":"2025-06-10T15:39:10.660Z","repository":{"id":45988184,"uuid":"84581805","full_name":"salsify/avro-resolution_canonical_form","owner":"salsify","description":"Unique identification of Avro schemas for schema resolution and compatibility","archived":false,"fork":false,"pushed_at":"2024-01-05T13:00:04.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-04-22T02:22:55.321Z","etag":null,"topics":["avro","gem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/salsify.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-03-10T16:56:15.000Z","updated_at":"2024-04-19T17:03:46.000Z","dependencies_parsed_at":"2023-02-08T14:31:35.869Z","dependency_job_id":"6cecf872-9850-44f3-a8e7-1960fb140b48","html_url":"https://github.com/salsify/avro-resolution_canonical_form","commit_stats":{"total_commits":14,"total_committers":7,"mean_commits":2.0,"dds":0.7142857142857143,"last_synced_commit":"e131c4911747df4700730dc58de5a7b08b7ba259"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salsify%2Favro-resolution_canonical_form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salsify%2Favro-resolution_canonical_form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salsify%2Favro-resolution_canonical_form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salsify%2Favro-resolution_canonical_form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salsify","download_url":"https://codeload.github.com/salsify/avro-resolution_canonical_form/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salsify%2Favro-resolution_canonical_form/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259104092,"owners_count":22805807,"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","gem"],"created_at":"2025-06-10T15:39:07.766Z","updated_at":"2025-06-10T15:39:10.640Z","avatar_url":"https://github.com/salsify.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# avro-resolution_canonical_form\n\nThis gem defines a [Resolution Canonical Form](#resolution_canonical_form) for Avro schemas.\nThis is similar to the [Parsing Canonical Form](http://avro.apache.org/docs/1.8.1/spec.html#Parsing+Canonical+Form+for+Schemas)\nfrom the Apache Avro spec, but extends is to also include attributes that are\nrelevant to schema resolution and compatibility.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'avro-resolution_canonical_form'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install avro-resolution_canonical_form\n\n## Resolution Canonical Form\n\nThe Resolution Canonical Form extends the [Parsing Canonical Form](http://avro.apache.org/docs/1.10.0/spec.html#Parsing+Canonical+Form+for+Schemas)\nto include `default` and `aliases` attributes and logical type for decimals:\n\n* [STRIP] Keep only attributes that are relevant to resolution, which are:\n  `name, type, fields, symbols, items, values, size, default, aliases, logical_type(=decimal), precision, scale`\n* [ORDER] Order the appearance of fields in JSON objects as follows:\n  `name, type, fields, symbols, items, values, size, default, aliases`\n* [ALIASES] [Aliases](http://avro.apache.org/docs/1.10.0/spec.html#Aliases) for\n  named types and fields are converted to their fullname, using applicable\n  namespace, and sorted.\n\n## Usage\n\n`Avro::ResolutionCanonicalForm` subclasses `Avro::SchemaNormalization`\nand provides a `to_resolution_form` method that returns the resolution canonical\nform for the schema:\n\n```ruby\nrequire 'avro-resolution_canonical_form'\n\nschema = Avro::Schema.parse(\u003c\u003c-JSON)\n  {\n    \"type\": \"record\",\n    \"name\": \"dimensions\",\n    \"aliases\": [\"dims\", \"eg.sizing\"],\n    \"namespace\": \"example\",\n    \"doc\": \"an example\",\n    \"fields\": [\n      { \"name\": \"height\", \"type\": \"int\", \"default\": 1, \"doc\": \"the height\" },\n      { \"name\": \"width\", \"aliases\": [\"across\"], \"type\": \"int\", \"doc\": \"the width\" }\n    ]\n  }\nJSON\n\nAvro::ResolutionCanonicalForm.to_resolution_form(schema)\n#=\u003e =\u003e \"{\\\"name\\\":\\\"example.dimensions\\\",\\\"type\\\":\\\"record\\\",\\\"fields\\\":[{\\\"name\\\":\\\"height\\\",\\\"type\\\":\\\"int\\\",\\\"default\\\":1},{\\\"name\\\":\\\"width\\\",\\\"type\\\":\\\"int\\\",\\\"aliases\\\":[\\\"across\\\"]}],\\\"aliases\\\":[\\\"eg.sizing\\\",\\\"example.dims\\\"]}\"\n```\n\nA new method, `#sha256_resolution_fingerprint`, is added to `Avro::Schema` to\nreturn the SHA256 digest based on the resolution form above. This is similar to\nthe existing `#sha256_fingerprint` which is based on the Parsing Canonical Form.\n\n```ruby\nschema.sha256_resolution_fingerprint\n\n#=\u003e 71676413924523555041213790831440929350080614901361467355865523343334332562796\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then,\nrun `rake spec` to run the tests. You can also run `bin/console` for an\ninteractive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. \n\nTo release a new version, update the version number in `version.rb`, and then\nrun `bundle exec rake release`, which will create a git tag for the version,\npush git commits and tags, and push the `.gem` file to\n[rubygems.org](https://rubygems.org)\n.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/salsify/avro-resolution_canonical_form.\n\n## License\n\nThe gem is available as open source under the terms of the\n[MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalsify%2Favro-resolution_canonical_form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalsify%2Favro-resolution_canonical_form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalsify%2Favro-resolution_canonical_form/lists"}