Validation of JSON LD documents
- Ruby 100%
|
dmathieu
7eeff0d0c6
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [rubocop](https://rubocop.org/) ([source](https://github.com/rubocop/rubocop), [changelog](https://github.com/rubocop/rubocop/releases/tag/v1.88.2)) | `1.88.1` → `1.88.2` |  |  | > ❗ **Important** > > Release Notes retrieval for this PR were skipped because no github.com credentials were available. > If you are self-hosted, please see [this instruction](https://github.com/renovatebot/renovate/blob/master/docs/usage/examples/self-hosting.md#githubcom-token-for-release-notes). --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNTkuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI1OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJydWJ5Il19--> Co-authored-by: Renovate Bot <forgejo-renovate-action@dmathieu.com> Reviewed-on: #52 |
||
|---|---|---|
| .forgejo/workflows | Update https://data.forgejo.org/actions/cache action to v6 ( #51 ) | |
| lib | fix linter | |
| spec | Update dependency rubocop-rspec to v3.10.2 ( #47 ) | |
| .gitignore | setup repository | |
| .rubocop.yml | find unknown fields in nested objects too | |
| .ruby-version | Update dependency ruby to v4.0.5 ( #45 ) | |
| Gemfile | setup basic matcher | |
| Gemfile.lock | Update dependency rubocop to v1.88.2 ( #52 ) | |
| json-ld-validate.gemspec | typos and remove unused dependencies | |
| LICENSE | setup repository | |
| Rakefile | setup repository | |
| README.md | setup manual validation class | |
| renovate.json | setup repository | |
JSON LD Validate
Validation of JSON LD documents.
Installation
Add this line to your Gemfile:
gem 'json-ld-validate'
RSpec matcher
Within your spec helper, require the gem:
require 'jsonld_validate'
And include the matchers within the rspec configuration:
RSpec.configure do |config|
config.include JsonldValidate::Matchers
end
Usage
Manuel
You can run the validator manually by using the JsonldValidate::Validator class:
content = {}
v = JsonldValidate::Validator.new(content)
puts v.valid?
RSpec
You can validate a JSON string being valid JSON-LD with the be_valid_jsonld matcher:
require 'spec_helper'
RSpec.describe 'User API' do
it 'provides json-ld' do
get :user, id: 1
expect(response.parsed_body).to be_valid_jsonld
end
end
Compatibility
JSON LD Validate ensures compatibility with the currently supported versions of the Ruby Language.