Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

update 'nested' to 'details' #27

Merged
merged 1 commit into from
Dec 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pages/posts/fixing-json-schema-output.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The first thing that everyone agreed on was isolating purpose for and renaming s

- `keywordLocation` ➡️ `evaluationPath`
- `absoluteSchemaLocation` (mostly optional) ➡️ `schemaLocation` (required)
- `errors`/`annotations` ➡️ `nested`
- `errors`/`annotations` ➡️ `details`

You can read the discussion for the rest of the proposed changes, but I want to focus on one in particular. At some point in the discussion, I had an epiphany:

Expand Down Expand Up @@ -152,7 +152,7 @@ In the above example, this means that we'd get two nodes: one for the root sche
"valid": true,
"evaluationPath": "",
"instanceLocation": "",
"nested": [
"details": [
{
"valid": true,
"evaluationPath": "/properties/foo",
Expand All @@ -175,7 +175,7 @@ That _does_ look a lot simpler. But what about annotations? Well, we can group
"foo"
]
},
"nested": [
"details": [
{
"valid": true,
"evaluationPath": "/properties/foo",
Expand All @@ -194,7 +194,7 @@ Alternatively for the `basic` format, which is supposed to be a list, the result
```json
{
"valid": true,
"nested": [
"details": [
{
"valid": true,
"evaluationPath": "",
Expand Down Expand Up @@ -226,7 +226,7 @@ _**NOTE** All of these examples (both old and new) are generated by my implement
```json
{
"valid": true,
"nested": [
"details": [
{
"valid": true,
"evaluationPath": "",
Expand Down Expand Up @@ -303,7 +303,7 @@ Let's look at the new output:
```json
{
"valid": false,
"nested": [
"details": [
{
"valid": false,
"evaluationPath": "",
Expand Down Expand Up @@ -339,7 +339,7 @@ Also, that nuance I mentioned appears: that `false` under `additionalProperties`
```json
{
"valid": false,
"nested": [
"details": [
{
"valid": false,
"evaluationPath": "/properties/foo",
Expand All @@ -362,4 +362,4 @@ So that's one way that I would like to update the output and the reasoning behin

Again, if you'd like to see what the impact of making this change in my implementation was, please have a look at [this PR](https://github.com/gregsdennis/json-everything/pull/308). All of these changes were driven by updating the output, but I think most of them are specific to my architecture, and some of them could be made to the library even without implementing the new output. The short summary, though, is the net -343 lines of code!

_Cover photo by [Daria Nepriakhina](https://unsplash.com/@epicantus) on [Unsplash](https://unsplash.com/photos/zoCDWPuiRuA)_ 😁
_Cover photo by [Daria Nepriakhina](https://unsplash.com/@epicantus) on [Unsplash](https://unsplash.com/photos/zoCDWPuiRuA)_ 😁