Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
feature(schema): Add Activity schema
Browse files Browse the repository at this point in the history
  • Loading branch information
killix committed Sep 28, 2017
1 parent eef3aad commit 41e9648
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions broid-schemas/lib/schemas/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"embedded/generator",
"embedded/group",
"embedded/tag",
"object/activity",
"object/collection",
"object/media",
"object/note",
Expand Down
1 change: 1 addition & 0 deletions broid-schemas/lib/schemas/object/activity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":"http://schemas.broid.ai/object/activity.json","type":"object","properties":{"type":{"type":"string","enum":["Activity"]},"id":{"type":"string"},"content":{"type":"string"},"context":{"oneOf":[{"$ref":"http://schemas.broid.ai/object/object.json"},{"type":"array","items":{"$ref":"http://schemas.broid.ai/object/object.json"}}]}},"required":["type","content"]}
2 changes: 1 addition & 1 deletion broid-schemas/lib/schemas/send.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"id":"http://schemas.broid.ai/send.json","type":"object","properties":{"@context":{"type":"string","enum":["https://www.w3.org/ns/activitystreams"]},"type":{"type":"string","enum":["Create","Update","Delete"]},"generator":{"$ref":"http://schemas.broid.ai/embedded/generator.json"},"to":{"oneOf":[{"$ref":"http://schemas.broid.ai/embedded/actor.json","required":["id","type"]},{"$ref":"http://schemas.broid.ai/embedded/group.json","required":["id","type"]}]},"object":{"oneOf":[{"$ref":"http://schemas.broid.ai/object/note.json","required":["type","content"]},{"$ref":"http://schemas.broid.ai/object/media.json","required":["type","url"]},{"$ref":"http://schemas.broid.ai/object/place.json","required":["type","latitude","longitude"]},{"$ref":"http://schemas.broid.ai/object/collection.json","required":["type","items"]}]}},"required":["type","generator","to","object"]}
{"id":"http://schemas.broid.ai/send.json","type":"object","properties":{"@context":{"type":"string","enum":["https://www.w3.org/ns/activitystreams"]},"type":{"type":"string","enum":["Create","Update","Delete"]},"generator":{"$ref":"http://schemas.broid.ai/embedded/generator.json"},"to":{"oneOf":[{"$ref":"http://schemas.broid.ai/embedded/actor.json","required":["id","type"]},{"$ref":"http://schemas.broid.ai/embedded/group.json","required":["id","type"]}]},"object":{"oneOf":[{"$ref":"http://schemas.broid.ai/object/activity.json","required":["type","content"]},{"$ref":"http://schemas.broid.ai/object/note.json","required":["type","content"]},{"$ref":"http://schemas.broid.ai/object/media.json","required":["type","url"]},{"$ref":"http://schemas.broid.ai/object/place.json","required":["type","latitude","longitude"]},{"$ref":"http://schemas.broid.ai/object/collection.json","required":["type","items"]}]}},"required":["type","generator","to","object"]}
1 change: 1 addition & 0 deletions broid-schemas/src/schemas/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- embedded/generator
- embedded/group
- embedded/tag
- object/activity
- object/collection
- object/media
- object/note
Expand Down
14 changes: 14 additions & 0 deletions broid-schemas/src/schemas/object/activity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type: object
properties:
type:
type: string
enum: [ Activity ]
id:
type: string
content:
type: string
context:
oneOf:
- $ref: "http://schemas.broid.ai/object/object.json"
- { type: array, items: { $ref: "http://schemas.broid.ai/object/object.json" } }
required: [ type, content ]
2 changes: 2 additions & 0 deletions broid-schemas/src/schemas/send.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ properties:
required: [ id, type ]
object:
oneOf:
- $ref: "http://schemas.broid.ai/object/activity.json"
required: [ type, content ]
- $ref: "http://schemas.broid.ai/object/note.json"
required: [ type, content ]
- $ref: "http://schemas.broid.ai/object/media.json"
Expand Down

0 comments on commit 41e9648

Please sign in to comment.