-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add endpoind field to linked_spaces, rename url field to website #92
Conversation
The discussions are linked in the PR :) I can write something about the "why" later |
@SpaceApi/core I think we should have another look at this PR:
If we decide to merge this PR, I'd even go so far as to make the |
I agree with @s3lph. I think we should stick to endpoint URLs for now. They are easy to understand, allow for easy redirecting, and don't require any additional parsing. If we decide to support some |
Decision in today's SpaceAPI core meeting:
|
Hm unless I'm mistaken the "any of" requirement can't be modeled with JSONSchema. We could use |
Why not? Reading https://json-schema.org/understanding-json-schema/reference/combining#anyOf it looks like it should be possible. |
Huh... why is So I guess we'd need to use something like this? "linked_spaces": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"endpoint": {
"type": "string"
}
},
"required": ["endpoint"]
},
{
"type": "object",
"properties": {
"website": {
"type": "string"
}
},
"required": ["website"]
}
]
}
} |
To my understanding you can extract all commen things out of the anyOf and just keep the required in it. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
15-draft.json
Outdated
"anyOf": [ | ||
"required": [ | ||
"endpoint" | ||
], | ||
"required": [ | ||
"website" | ||
] |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it with https://json-schema.hyperjump.io/ and it worked the way I expected it to work.
By adding a field to specify the SpaceAPI endpoints of other spaces self discovery of the spaces in the SpaceAPI network becomes possible. This change would eventually allow for a SpaceAPI that is functional without the central directory.
If the endpoint field is filled out then the URL field of the linked space should be left absent as the url can instead be read from the spaces own SpaceAPI endpoint. Because of this I've made the URL endpoint optional.