-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
encoding/jsonschema: avoid unnecessary alias to root
Issue #3354 demonstrates that aliases are used when they're not actually needed. When investigating the fix for #2287, I realised where the problem might be, and this is the result. The problem was that all the self-references need to reference the same AST node, but they were not doing so. Fix that by creating the struct node to be embedded when we know that we need a self-reference. We can also use the presence of that node to signal that a self-reference is needed, removing the need for `hasSelfReference`. Fixes #3354 Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: Ie886b5819c612cbd64abca62d3231aedd530e2bf Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199626 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
- Loading branch information
Showing
5 changed files
with
42 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters