Skip to content

Commit

Permalink
Fix bundling example
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Apr 10, 2024
1 parent 7eaf3ab commit 9277724
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DISTVERSION = $(shell perl -nE '/^version\s*=\s*"([^"]+)/ && do { say $$1; exit
PGRXV = $(shell perl -nE '/^pgrx\s+=\s"=?([^"]+)/ && do { say $$1; exit }' Cargo.toml)
PGV = $(shell perl -E 'shift =~ /(\d+)/ && say $$1' "$(shell $(PG_CONFIG) --version)")

.DEFAULT_GOAL: package # Build jsonshcmea for the PostgreSQL cluster identified by pg_config.
.DEFAULT_GOAL: package # Build jsonschmea for the PostgreSQL cluster identified by pg_config.
package:
@cargo pgrx package --pg-config "$(PG_CONFIG)"

Expand Down
8 changes: 4 additions & 4 deletions doc/jsonschema.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ SELECT '{
},
"required": ["first_name", "last_name", "shipping_address", "billing_address"],
"$defs": {
"address": {
"$id": "/schemas/address",
"https://example.com/schemas/address": {
"$id": "https://example.com/schemas/address",
"type": "object",
"properties": {
"street_address": { "type": "string" },
Expand All @@ -225,8 +225,8 @@ SELECT '{
```

Note that the only change to the address schema is tha it has been embedded in
the `$defs` object and its `$id` is no longer fully-qualified. Now with this
one bundled schema, we can omit the `id` parameter:
the `$defs` object using its `$id` for the key. With this schema bundle, we
can omit the `id` parameter:

```psql
SELECT jsonschema_is_valid(:'cust_schema'::json);
Expand Down

0 comments on commit 9277724

Please sign in to comment.