Skip to content

Commit

Permalink
internal/patch: fix tutorial gold content for tip
Browse files Browse the repository at this point in the history
This updates the patch that permits the site to build against the tip of
cue-lang/cue to cope with changes from https://cuelang.org/cl/1202854
where an explicit `close()` can be included when importing JSON Schema
documents.

Manual changes to fix this problem (i.e. in the patch) are required as
the preprocessor's --update flag doesn't currently cater for in-page use
of manual "diff" commands. A comment will be left in cue-lang/cue#2798
requesting that any solution to that issue should consider scenarios
like this.

Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I67de3abbff568b857c5215ccb5568c07bd19307a
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1204138
Reviewed-by: Paul Jolly <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
jpluscplusm committed Nov 18, 2024
1 parent 2518df3 commit 7d152f4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions internal/patch/tip.diff
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,29 @@ index 771d24ec..ea3def82 100755
do
rsync -a --relative --delete $td/$path@$version/internal/./$i/ ./internal/cuelang_org_go_internal/
find ./internal/cuelang_org_go_internal/$i -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} +
diff --git a/content/docs/tutorial/converting-json-schema-to-cue/en.md b/content/docs/tutorial/converting-json-schema-to-cue/en.md
index cccda35d..461cb965 100644
--- a/content/docs/tutorial/converting-json-schema-to-cue/en.md
+++ b/content/docs/tutorial/converting-json-schema-to-cue/en.md
@@ -128,14 +128,16 @@ package cuisine

#restaurant: {
@jsonschema(schema="http://json-schema.org/draft-07/schema#")
- name!: string
- cuisine!: string
- tables!: [...#table]
+ close({
+ name!: string
+ cuisine!: string
+ tables!: [...#table]
+ })

- #table: {
+ #table: close({
seats!: >=2 & <=10
view?: bool
- }
+ })
}
{{{end}}}

0 comments on commit 7d152f4

Please sign in to comment.