diff options
author | 2024-12-20 20:01:00 +0100 | |
---|---|---|
committer | 2025-02-19 19:02:11 +0100 | |
commit | 1af7db8185394e9fd743e9e127c62a1837773ab4 (patch) | |
tree | b4a2a34f32930c8770c9542d8a622e6a9a585cfd /docs | |
parent | 41836618067348df941df48145d8e4f8e6251f64 (diff) |
`$fileName` -> `$id`, drop extension
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api-reference.md | 36 | ||||
-rw-r--r-- | docs/get-started-cli.md | 8 |
2 files changed, 22 insertions, 22 deletions
diff --git a/docs/api-reference.md b/docs/api-reference.md index 248ab8c..fd09ecc 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -17,11 +17,11 @@ curl -X POST http://localhost:8081/api/rest/collection/entity --data @- <<'EOF' EOF ``` -Note that the created entity is returned, including the meta field `$fileName`. +Note that the created entity is returned, including the meta field `$id`. ```json { - "$fileName": "9474f0eb-06d7-4fd8-b89e-0ce996962508.json", + "$id": "9474f0eb-06d7-4fd8-b89e-0ce996962508", "description": "Description of entity 1", "name": "Entity 1" } @@ -40,7 +40,7 @@ EOF ```json { - "$fileName": "ccccc18c-f3dc-4f98-b4d2-290ef76adb6b.json", + "$id": "ccccc18c-f3dc-4f98-b4d2-290ef76adb6b", "description": "Description of entity 2", "name": "Entity 2" } @@ -61,7 +61,7 @@ As one would expect, the schema lists the fields `name`, `description` as requir "$id": "entity.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { - "$fileName": { + "$id": { "type": "string" }, "description": { @@ -72,7 +72,7 @@ As one would expect, the schema lists the fields `name`, `description` as requir } }, "required": [ - "$fileName", + "$id", "description", "name" ], @@ -83,15 +83,15 @@ As one would expect, the schema lists the fields `name`, `description` as requir ### Retrieving a single collection entity -Single collection entities can be retrieved using their unique `$fileName` identifier. +Single collection entities can be retrieved using their unique `$id` identifier. ```console -curl http://localhost:8081/api/rest/collection/entity/9474f0eb-06d7-4fd8-b89e-0ce996962508.json | jq . +curl http://localhost:8081/api/rest/collection/entity/9474f0eb-06d7-4fd8-b89e-0ce996962508 | jq . ``` ```json { - "$fileName": "9474f0eb-06d7-4fd8-b89e-0ce996962508.json", + "$id": "9474f0eb-06d7-4fd8-b89e-0ce996962508", "description": "Description of entity 1", "name": "Entity 1" } @@ -108,12 +108,12 @@ curl http://localhost:8081/api/rest/collection/entity | jq . ```json [ { - "$fileName": "9474f0eb-06d7-4fd8-b89e-0ce996962508.json", + "$id": "9474f0eb-06d7-4fd8-b89e-0ce996962508", "description": "Description of entity 1", "name": "Entity 1" }, { - "$fileName": "ccccc18c-f3dc-4f98-b4d2-290ef76adb6b.json", + "$id": "ccccc18c-f3dc-4f98-b4d2-290ef76adb6b", "description": "Description of entity 2", "name": "Entity 2" } @@ -125,7 +125,7 @@ curl http://localhost:8081/api/rest/collection/entity | jq . Updating a collection entity is possible by send only select fields. ```console -curl -X PUT http://localhost:8081/api/rest/collection/entity/ccccc18c-f3dc-4f98-b4d2-290ef76adb6b.json --data @- <<'EOF' | jq . +curl -X PUT http://localhost:8081/api/rest/collection/entity/ccccc18c-f3dc-4f98-b4d2-290ef76adb6b --data @- <<'EOF' | jq . { "description": "Entity 2 description" } @@ -136,7 +136,7 @@ The endpoint returns the full, updated entity. ```json { - "$fileName": "ccccc18c-f3dc-4f98-b4d2-290ef76adb6b.json", + "$id": "ccccc18c-f3dc-4f98-b4d2-290ef76adb6b", "description": "Entity 2 description", "name": "Entity 2" } @@ -145,7 +145,7 @@ The endpoint returns the full, updated entity. Fields can be deleted setting them their values to `null`. ```console -curl -X PUT http://localhost:8081/api/rest/collection/entity/ccccc18c-f3dc-4f98-b4d2-290ef76adb6b.json --data @- <<'EOF' | jq . +curl -X PUT http://localhost:8081/api/rest/collection/entity/ccccc18c-f3dc-4f98-b4d2-290ef76adb6b --data @- <<'EOF' | jq . { "description": null } @@ -156,7 +156,7 @@ Again, the response contains the full entity after the update. ```json { - "$fileName": "ccccc18c-f3dc-4f98-b4d2-290ef76adb6b.json", + "$id": "ccccc18c-f3dc-4f98-b4d2-290ef76adb6b", "name": "Entity 2" } ``` @@ -176,7 +176,7 @@ curl http://localhost:8081/api/rest/collection/entity/schema | jq . "$id": "entity.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { - "$fileName": { + "$id": { "type": "string" }, "description": { @@ -187,7 +187,7 @@ curl http://localhost:8081/api/rest/collection/entity/schema | jq . } }, "required": [ - "$fileName", + "$id", "name" ], "title": "entity", @@ -208,12 +208,12 @@ curl http://localhost:8081/api/rest/schemaVersion | jq . ### Deleting collection entities ```console -curl -X DELETE http://localhost:8081/api/rest/collection/entity/9474f0eb-06d7-4fd8-b89e-0ce996962508.json | jq . +curl -X DELETE http://localhost:8081/api/rest/collection/entity/9474f0eb-06d7-4fd8-b89e-0ce996962508 | jq . ``` ```json { - "$fileName": "9474f0eb-06d7-4fd8-b89e-0ce996962508.json", + "$id": "9474f0eb-06d7-4fd8-b89e-0ce996962508", "description": "Description of entity 1", "name": "Entity 1" } diff --git a/docs/get-started-cli.md b/docs/get-started-cli.md index 22c0a0f..46ee2cb 100644 --- a/docs/get-started-cli.md +++ b/docs/get-started-cli.md @@ -25,7 +25,7 @@ Take note of the `$fileName` in the output. Note that it should be different for ```json { - "$fileName": "9474f0eb-06d7-4fd8-b89e-0ce996962508.json", + "$id": "9474f0eb-06d7-4fd8-b89e-0ce996962508", "description": "Welcome to Biscotte restaurant! Restaurant Biscotte offers a cuisine based on fresh, quality products, often local, organic when possible, and always produced by passionate producers.", "name": "Biscotte Restaurant" } @@ -37,7 +37,7 @@ Take note of the `$fileName` in the output. Note that it should be different for acms collection add category <<'EOF' { "name": "French Food", - "restaurant": { "$ref": "restaurant/9474f0eb-06d7-4fd8-b89e-0ce996962508.json" } + "restaurant": { "$ref": "restaurant/9474f0eb-06d7-4fd8-b89e-0ce996962508" } } EOF ``` @@ -46,7 +46,7 @@ EOF acms collection add category <<'EOF' { "name": "Brunch", - "restaurant": { "$ref": "restaurant/9474f0eb-06d7-4fd8-b89e-0ce996962508.json" } + "restaurant": { "$ref": "restaurant/9474f0eb-06d7-4fd8-b89e-0ce996962508" } } EOF ``` @@ -68,7 +68,7 @@ curl 'http://localhost:8081/api/query' --data ' LEFT JOIN category ON - category.restaurant == restaurant.$fileName + category.restaurant == restaurant.$id ' | jq . ``` |