-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added initial JSON Schema validation. Updated delivery code. Fixed issues with MediaTypeRoute.
- Loading branch information
1 parent
5cd19d8
commit f7ff705
Showing
11 changed files
with
471 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,3 +163,4 @@ cython_debug/ | |
|
||
.ruff_cache | ||
.DS_Store | ||
.report.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "schema:activities", | ||
"anyOf": [ | ||
{ | ||
"$ref": "schema:create" | ||
}, | ||
{ | ||
"properties": { | ||
"type": { | ||
"anyOf": [ | ||
{ | ||
"type": "string", | ||
"enum": [ | ||
"Follow", | ||
"Reject", | ||
"Accept", | ||
"Undo" | ||
] | ||
}, | ||
{ | ||
"type": "string", | ||
"format": "uri", | ||
"description": "A URI identifying the type of activity" | ||
}, | ||
{ | ||
"type": "string", | ||
"pattern": ".*:.*", | ||
"description": "A prefixed activity type name" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "schema:actor", | ||
"$ref": "schema:object", | ||
"description": "An Actor. https://www.w3.org/TR/activitystreams-core/#actors", | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"type": { | ||
"oneOf": [ | ||
{ | ||
"const": "Person" | ||
}, | ||
{ | ||
"const": "Group" | ||
}, | ||
{ | ||
"const": "Service" | ||
} | ||
] | ||
}, | ||
"inbox": { | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"outbox": { | ||
"type": "string", | ||
"format": "uri" | ||
} | ||
}, | ||
"required": [ | ||
"id", | ||
"type", | ||
"inbox", | ||
"outbox" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "schema:activity", | ||
"$ref": "schema:object", | ||
"description": "An Activity. https://www.w3.org/TR/activitystreams-core/#activities", | ||
"type": "object", | ||
"properties": { | ||
"actor": { | ||
"$ref": "schema:object#/definitions/UriOrListOfUris" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "schema:create", | ||
"description": "An Activity. https://www.w3.org/TR/activitystreams-core/#activities", | ||
"type": "object", | ||
"allOf": [ | ||
{ | ||
"$ref": "schema:base-activity" | ||
}, | ||
{ | ||
"properties": { | ||
"type": { | ||
"anyOf": [ | ||
{ | ||
"const": "Create" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"contains": { | ||
"const": "Create" | ||
} | ||
} | ||
] | ||
}, | ||
"object": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "schema:object" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"$ref": "schema:object" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"required": [ | ||
"object" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "schema:object", | ||
"description": "An Object. Restriction of https://www.w3.org/TR/activitystreams-core/#asobject", | ||
"type": "object", | ||
"definitions": { | ||
"UriOrObject": { | ||
"anyOf": [ | ||
{ | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
{ | ||
"type": "object" | ||
} | ||
] | ||
}, | ||
"UriOrListOfUris": { | ||
"anyOf": [ | ||
{ | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"format": "uri" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"type": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"type" | ||
] | ||
} |
Oops, something went wrong.