Skip to content

Commit

Permalink
init 2.2 schema
Browse files Browse the repository at this point in the history
by adjust current version and add test for it
  • Loading branch information
6543 committed Dec 6, 2023
1 parent 5263940 commit 89e1e83
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion schemas/2.2/example.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.1",
"version": "2.2",
"software": {
"name": "diaspora",
"version": "0.5.0",
Expand Down
9 changes: 5 additions & 4 deletions schemas/2.2/schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"title": "NodeInfo schema version 2.2",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://nodeinfo.diaspora.software/ns/schema/2.1#",
"description": "NodeInfo schema version 2.1.",
"id": "http://nodeinfo.diaspora.software/ns/schema/2.2#",
"description": "NodeInfo is an effort to create a standardized way of exposing metadata about a server running one of the distributed social networks.",
"type": "object",
"additionalProperties": false,
"required": [
Expand All @@ -15,9 +16,9 @@
],
"properties": {
"version": {
"description": "The schema version, must be 2.1.",
"description": "The schema version, must be 2.2.",
"enum": [
"2.1"
"2.2"
]
},
"software": {
Expand Down
11 changes: 11 additions & 0 deletions tests/spec/nodeinfo_22_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require "spec_helper"

RSpec.describe "NodeInfo schema 2.2" do
it "is a valid draft7 json schema" do
expect(schema_for("2.2")).to match_json_schema :json_schema_draft4
end

it "validates the example" do
expect(example_for("2.2")).to match_json_schema :nodeinfo_22
end
end

0 comments on commit 89e1e83

Please sign in to comment.