Skip to content

Commit

Permalink
init 3.0 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 4, 2023
1 parent 32cbcab commit f7e1065
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion schemas/3.0/example.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.1",
"version": "3.0",
"software": {
"name": "diaspora",
"version": "0.5.0",
Expand Down
9 changes: 5 additions & 4 deletions schemas/3.0/schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"title": "NodeInfo schema version 3.0",
"$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/3.0#",
"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 3.0.",
"enum": [
"2.1"
"3.0"
]
},
"software": {
Expand Down
11 changes: 11 additions & 0 deletions tests/spec/nodeinfo_30_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require "spec_helper"

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

it "validates the example" do
expect(example_for("3.0")).to match_json_schema :nodeinfo_30
end
end

0 comments on commit f7e1065

Please sign in to comment.