-
Notifications
You must be signed in to change notification settings - Fork 1
Schema JSON for Delta Structures #338
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
Conversation
Shall we have abstract base types?Shall we group our messages through types like Pro:
Con:
Decision: We won't have abstract base types if not absolutely needed |
Shall we have convenience types?Some classes like NOTE: Some other types like Pro:
Con:
Decision: Flatten types, don't use convenience structures |
Please feel free to edit my comments above to add more pros/cons. |
delta/json-schema/delta-protocol.ess
Outdated
@@ -0,0 +1,842 @@ | |||
namespace Lion.WebCore.Serialization |
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.
As discussed with Pedro, we don't want to merge this file in the end. It's just more convenient to discuss the structures in this format than raw JSONSchema.
delta/json-schema/json-schema.adoc
Outdated
the inheritance to simple structures. | ||
2. Non public types and intermediate types & abstractions can be avoided | ||
from the final JSON Schema to make it as simple as possible. | ||
3. There are many concepts with some kind of variant permutations. |
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.
Agree: some kind of usage of traits/mixins might be useful to cut down on the apparent complexity due to the sheer number of variations.
delta/json-schema/json-schema.adoc
Outdated
from the final JSON Schema to make it as simple as possible. | ||
3. There are many concepts with some kind of variant permutations. | ||
Any simplification we can come up will definelty increase adoption chances. | ||
Any simplification we can come up will definetly increase adoption chances. |
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.
It’s definitely “definitely” ;)
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.
oh my good. Fixing! ;-)
delta/json-schema/delta-protocol.ess
Outdated
@@ -20,6 +20,13 @@ namespace Lion.WebCore.Serialization | |||
} | |||
class SerializedNode | |||
{ | |||
string Id; |
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.
Wouldn’t it be useful to have a type alias Id
?
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 don't think there are type aliases in JsonSchema
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.
But this is (C#-like) Essential code.
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.
... which will never be merged, as per #338 (comment)
"required": [] | ||
"properties": { | ||
"Id": { | ||
"type": "string" |
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.
Wouldn’t it be useful to have an explicit type Id
? btw: We have a JSON Schema for the serialization format: https://github.com/LionWeb-io/specification/blob/main/2023.1/serialization/serialization.schema.json
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 agree that this would be useful, "type": LionWebId"
is more informative.
I would like to mainly discuss structure here, not human language style |
Renamed to end with schema.json so all the tools understand this is a JSON Schema.
… pjmolina/delta-json-schema
Example instances at https://github.com/LionWeb-io/lionweb-integration-testing/tree/niko/delta-api/delta |
The |
In the most recent version, I changed that to be just the array of nodes. That's my reasoning, but I don't have a very strong opinion on it. Mentioning the LW version opens another option for inconsistency, but I could live with it. |
I merge this with #288, as they develop together |
I put this into #358 |
Schema JSON for Delta Structures
This PR provides:
Validation
Sample online validator for JSON Schema: https://json-schema.hyperjump.io/
Discussion
Translation considerations from C# to Essential:
Design considerations