{"id":27804052,"url":"https://github.com/brunoarueira/validates_xml_of","last_synced_at":"2025-05-01T08:17:34.036Z","repository":{"id":5875458,"uuid":"53947576","full_name":"brunoarueira/validates_xml_of","owner":"brunoarueira","description":"Validates if an attribute has a valid xml content or a xsd valid content","archived":false,"fork":false,"pushed_at":"2022-04-17T18:20:55.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-01T08:17:25.782Z","etag":null,"topics":["schema","xml","xsd"],"latest_commit_sha":null,"homepage":null,"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/brunoarueira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-15T13:39:16.000Z","updated_at":"2022-04-17T18:13:05.000Z","dependencies_parsed_at":"2022-08-06T19:00:56.591Z","dependency_job_id":null,"html_url":"https://github.com/brunoarueira/validates_xml_of","commit_stats":null,"previous_names":["brunoarueira/validates_xml"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoarueira%2Fvalidates_xml_of","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoarueira%2Fvalidates_xml_of/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoarueira%2Fvalidates_xml_of/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoarueira%2Fvalidates_xml_of/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brunoarueira","download_url":"https://codeload.github.com/brunoarueira/validates_xml_of/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251843654,"owners_count":21652855,"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":["schema","xml","xsd"],"created_at":"2025-05-01T08:17:33.485Z","updated_at":"2025-05-01T08:17:34.031Z","avatar_url":"https://github.com/brunoarueira.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ValidatesXmlOf\n\n[![Build Status](https://travis-ci.org/brunoarueira/validates_xml_of.svg?branch=master)](https://travis-ci.org/brunoarueira/validates_xml_of)\n[![Code Climate](https://codeclimate.com/github/brunoarueira/validates_xml_of/badges/gpa.svg)](https://codeclimate.com/github/brunoarueira/validates_xml_of)\n[![Test Coverage](https://codeclimate.com/github/brunoarueira/validates_xml_of/badges/coverage.svg)](https://codeclimate.com/github/brunoarueira/validates_xml_of/coverage)\n\nValidates if a given string contains a valid xml and validates based on defined\nschema too.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'validates_xml_of'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install validates_xml_of\n\n## Usage\n\n### Rails\n\nIf you do not want to use xsd:\n\n```\nclass Post \u003c ActiveRecord::Base\n  ...\n\n  validates :content, xml: true\n\n  ...\nend\n```\n\nAnd if you want to use xsd, you will need to define an initializer to setup a path for your schemas:\n\n```\nValidatesXmlOf.setup do |config|\n  config.schema_paths = \"lib/xsds\"\nend\n```\n\nAfter, you need to set your validation to specify what schema you are looking for:\n\n```\nclass Post \u003c ActiveRecord::Base\n  ...\n  # The schema must be in lib/xsds/Schema.xsd\n  validates :content, xml: { schema: 'Schema' }\n  ...\nend\n```\n\n***PS:*** Coming soon, I will implement a generator to create this initializer\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/brunoarueira/validates_xml. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunoarueira%2Fvalidates_xml_of","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunoarueira%2Fvalidates_xml_of","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunoarueira%2Fvalidates_xml_of/lists"}