From 89e1e83fc1f0523b48313b9907d0bc38845fc5ca Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 6 Dec 2023 12:27:20 +0100 Subject: [PATCH] init 2.2 schema by adjust current version and add test for it --- schemas/2.2/example.json | 2 +- schemas/2.2/schema.json | 9 +++++---- tests/spec/nodeinfo_22_spec.rb | 11 +++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 tests/spec/nodeinfo_22_spec.rb diff --git a/schemas/2.2/example.json b/schemas/2.2/example.json index b0bfa07..b83a70e 100644 --- a/schemas/2.2/example.json +++ b/schemas/2.2/example.json @@ -1,5 +1,5 @@ { - "version": "2.1", + "version": "2.2", "software": { "name": "diaspora", "version": "0.5.0", diff --git a/schemas/2.2/schema.json b/schemas/2.2/schema.json index 561e644..8908712 100644 --- a/schemas/2.2/schema.json +++ b/schemas/2.2/schema.json @@ -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": [ @@ -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": { diff --git a/tests/spec/nodeinfo_22_spec.rb b/tests/spec/nodeinfo_22_spec.rb new file mode 100644 index 0000000..e00b7a6 --- /dev/null +++ b/tests/spec/nodeinfo_22_spec.rb @@ -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