-
-
Notifications
You must be signed in to change notification settings - Fork 326
initial contribution, invited by Juan #1880
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi @agilevic! Thanks a lot for your contribution! I noticed that the following required information is missing or incomplete: issue reference Please update the PR description to include this information. You can find placeholders in the PR template for these items. Thanks a lot! |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1880 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 30 30
Lines 633 633
Branches 196 196
=========================================
Hits 633 633 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@json-schema-org/docs-team @json-schema-org/tsc Can you help with your own reviews for this blog post? @agilevic and I have been talking for a while and SlashDB is a very nice "database gateway" that generates JSON Schema. I think it will be a great addition for the case studies! |
|
@jviotti do you want to unblock this? There is no issue reference to give. Thanks. |
|
No worries. Feel free to ignore that check. But let me ping the team again for reviews |
jdesrosiers
left a comment
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.
Looks fine to me. My only concern is that I'm not a fan of the "type": [whatever, "null"] pattern and I'm concerned that people are going to read this article and think that's a recommended way to describe optional properties. I think it would be helpful to explain why you need to support two different ways for a property to not be present (defined with null or not defined) and note that this is not typical and not always the right approach.
As a style suggestion, I found the schemas hard to read because they span multiple screens that I need to scroll through. I suggest using,
"type": ["string", "null"]instead of,
"type": [
"string",
"null"
]This will make the schemas significantly more compact and I think easier to read.
| {"http_code": 400, "description": "Could not parse JSON: The \"BirthDate\": error at node '/0/BirthDate': '01-01-2000' is not a 'date-time'"} | ||
| ``` | ||
|
|
||
| The validator used the `format` property of the `BirthDate` to check that the value was formatted as an IS0 8601 datetime string, and detected an error. |
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.
Typo in ISO.
| The validator used the `format` property of the `BirthDate` to check that the value was formatted as an IS0 8601 datetime string, and detected an error. | |
| The validator used the `format` property of the `BirthDate` to check that the value was formatted as an ISO 8601 datetime string, and detected an error. |
However, date-time uses RFC 3339, not ISO 8601.
gregsdennis
left a comment
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.
Overall an interesting article. It's neat that you've been able to integrate JSON Schema this tightly into the DB.
I do have some comments, but they're largely editorial. The base content looks great. Thanks for writing this up.
| excerpt: "As modern multi-model databases increasingly support JSON, it's time to explore what role JSON schema will play." | ||
| --- | ||
|
|
||
| JSON Schema has become the backbone of modern API design—not just for describing data types, but for enforcing consistency, validating input, and communicating intent between systems. Beyond simple type declarations, schemas can capture constraints like string lengths, date formats, nullability, and even complex conditional logic. |
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.
| Now let's retrieve the schema for this record: | ||
| https://demo.slashdb.com/db/Chinook/Employee/EmployeeId/1.json?schema | ||
|
|
||
| ``` |
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 think it would be good to try to reduce the height of this code block a bit. You can collapse short arrays and objects. You might also consider wrapping it in an expandable element (<details>).
| https://demo.slashdb.com/db/Chinook/Employee.json?schema | ||
|
|
||
| ``` | ||
| { |
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.
Reduce/collapse
| To pull multiple records: | ||
|
|
||
| https://demo.slashdb.com/db/Chinook/Employee.json?limit=3 | ||
|
|
||
| And the schema: | ||
|
|
||
| https://demo.slashdb.com/db/Chinook/Employee.json?schema |
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.
This could be improved with some additional prose, e.g. "To pull multiple records, you'd use:", etc.
Then I'd put the links in code block. This doesn't seem like a link you want people to follow.
| One other parameter we can use with **SlashDB**'s schemas is the `cardinality` query string parameter: | ||
|
|
||
| https://demo.slashdb.com/db/Chinook/Employee.json?schema&cardinality=3 |
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.
The prose here is better, but I'd still put the link in a code block.
|
|
||
| Now, the schema: | ||
|
|
||
| https://demo.slashdb.com/querydef/active-users.json?schema |
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.
Code block
|
|
||
| https://demo.slashdb.com/querydef/active-users.json?schema | ||
|
|
||
| ``` |
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.
reduce/collapse
|
|
||
| We see that the `pattern` attribute is present in several portions of the schema here. Used in conjunction with `string`, `pattern` allows you to specify a regular expression that a value must match against. | ||
|
|
||
| E.g - the `query_id` attribute, which is a unique string that identifies the query, must be no more than 128 characters long (`maxLength` property), and the string must match [this regular expression](https://regex101.com/r/2crKdN/2) - `^(?![xX][mM][lL])[a-zA-Z_][a-zA-Z0-9@_~-]`. |
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.
"e.g." is typically not used at the beginning of a sentence. I recommend writing it out, e.g. "For example, ...".
Additionally, the em dash doesn't fit here.
|
|
||
| E.g - the `query_id` attribute, which is a unique string that identifies the query, must be no more than 128 characters long (`maxLength` property), and the string must match [this regular expression](https://regex101.com/r/2crKdN/2) - `^(?![xX][mM][lL])[a-zA-Z_][a-zA-Z0-9@_~-]`. | ||
|
|
||
| We also see the `oneOf` attribute - used here to define that an attribute is either null/not present, or an array of `items` (e.g. the `read` or `write` properties). |
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.
em dash consistency
|
|
||
| ### Conclusion: JSON Schema as a Bridge Between Data and APIs | ||
|
|
||
| What we’ve seen through SlashDB is more than just schema decoration—it’s JSON Schema acting as a **bridge** between relational data models and modern web APIs. By embedding constraints like `maxLength`, `format`, and `pattern` directly into schemas, SlashDB ensures that data integrity is preserved not only in the database but also at the API boundary. |
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.
em dash consistency

What kind of change does this PR introduce?
New blog post; invited to contribute by @jviotti
You can change the type to Engineering if more appropriate.