diff --git a/pages/posts/fixing-json-schema-output.md b/pages/posts/fixing-json-schema-output.md index 323ec00b..a64fe16b 100644 --- a/pages/posts/fixing-json-schema-output.md +++ b/pages/posts/fixing-json-schema-output.md @@ -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: @@ -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", @@ -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", @@ -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": "", @@ -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": "", @@ -303,7 +303,7 @@ Let's look at the new output: ```json { "valid": false, - "nested": [ + "details": [ { "valid": false, "evaluationPath": "", @@ -339,7 +339,7 @@ Also, that nuance I mentioned appears: that `false` under `additionalProperties` ```json { "valid": false, - "nested": [ + "details": [ { "valid": false, "evaluationPath": "/properties/foo", @@ -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)_ 😁 \ No newline at end of file +_Cover photo by [Daria Nepriakhina](https://unsplash.com/@epicantus) on [Unsplash](https://unsplash.com/photos/zoCDWPuiRuA)_ 😁