From 38c482779166cc249d7459243792c8df79cf842b Mon Sep 17 00:00:00 2001 From: D024504 Date: Thu, 18 Apr 2024 09:21:20 +0200 Subject: [PATCH] Reference example, don't copy it --- vocabularies/Org.OData.JSON.V1.json | 2 +- vocabularies/Org.OData.JSON.V1.md | 52 +++++++++++------------------ vocabularies/Org.OData.JSON.V1.xml | 14 +------- 3 files changed, 22 insertions(+), 46 deletions(-) diff --git a/vocabularies/Org.OData.JSON.V1.json b/vocabularies/Org.OData.JSON.V1.json index e0fbb4b9..953b52c6 100644 --- a/vocabularies/Org.OData.JSON.V1.json +++ b/vocabularies/Org.OData.JSON.V1.json @@ -13,7 +13,7 @@ "Org.OData.JSON.V1": { "$Alias": "JSON", "@Core.Description": "Terms, types, and functions for JSON data", - "@Core.LongDescription": "OData [stream properties](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ManagingStreamProperties) allow embedding data of arbitrary media types,\nand the OData JSON format allows [direct embedding of JSON data](https://docs.oasis-open.org/odata/odata-json-format/v4.01/odata-json-format-v4.01.html#sec_StreamProperty) in request and response payloads.\n\nThis vocabulary defines a convenience [type for JSON data](#JSON) as well as a term for referencing a [JSON Schema](#Schema) describing the structure of the JSON data.\n\nIn addition it defines two functions for [querying](#query) JSON data and using a [primitive value](#value) extracted from JSON data in common expressions, for example in `$filter`, `$orderby`, or `$compute`.\n\n**Example**\n\nThe `Employees` entity set has a JSON data property `resume`:\n```json\n\"container\": {\n \"$Kind\": \"EntityContainer\",\n \"Employees\": { \"$Collection\": true, \"$Type\": \"this.Employee\" }\n},\n\"Employee\": {\n \"$Kind\": \"EntityType\",\n \"$Key\": [\"empid\"],\n \"empid\": { \"$Type\": \"Edm.Int32\" },\n \"resume\": { \"$Type\": \"JSON.JSON\", \"$Nullable\": true }\n}\n```\n\nOne of its entities has a `resume` value of\n```json\n{ \n \"ssn\": \"1234\", \n \"lastname\": \"Doe\", \n \"address\": {\n \"zipcode\": \"10022\", \n \"street\": \"ABC st\"\n },\n \"experience\": \"excellent\"\n}\n```\n\nThis allows to filter and sort by values in that resume, and extract parts of the resume as a dynamic JSON data property\n```http\nGET http://www.example.com/mycompany/Employees\n ?$filter=resume/JSON.value(path='$.lastname') eq 'Doe'\n &$orderby=resume/JSON.valueNumber(path='$.experience')\n &$compute=resume/JSON.query(path='$.address') as address\n &$expand=address\n```\nreceiving\n```json\n{ \n \"@odata.context\": \"$metadata#Employees\", \n \"value\": [ \n {\n \"empid\": 4711,\n \"address\": {\n \"zipcode\": \"10022\", \n \"street\": \"ABC st\"\n }\n },\n ...\n ]\n}\n```\n ", + "@Core.LongDescription": "OData [stream properties](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ManagingStreamProperties) allow embedding data of arbitrary media types,\nand the OData JSON format allows [direct embedding of JSON data](https://docs.oasis-open.org/odata/odata-json-format/v4.01/odata-json-format-v4.01.html#sec_StreamProperty) in request and response payloads.\n\nThis vocabulary defines a convenience [type for JSON data](#JSON) as well as a term for referencing a [JSON Schema](#Schema) describing the structure of the JSON data.\n\nIn addition it defines two functions for [querying](#query) JSON data and using a [primitive value](#value) extracted from JSON data in common expressions, for example in `$filter`, `$orderby`, or `$compute`.\n\n**Example**\n\nThe `Employees` entity set has a JSON data property `resume` (see [CSDL JSON](../examples/Org.OData.JSON.V1.Schema-sample.json) or [CSDL XML](../examples/Org.OData.JSON.V1.Schema-sample.xml)).\n\nOne of its entities has a `resume` value of\n```json\n{ \n \"ssn\": \"1234\", \n \"lastname\": \"Doe\", \n \"address\": {\n \"zipcode\": \"10022\", \n \"street\": \"ABC st\"\n },\n \"experience\": \"excellent\"\n}\n```\n\nThis allows to filter and sort by values in that resume, and extract parts of the resume as a dynamic JSON data property\n```http\nGET http://www.example.com/mycompany/Employees\n ?$filter=resume/JSON.value(path='$.lastname') eq 'Doe'\n &$orderby=resume/JSON.valueNumber(path='$.experience')\n &$compute=resume/JSON.query(path='$.address') as address\n &$expand=address\n```\nreceiving\n```json\n{ \n \"@odata.context\": \"$metadata#Employees\", \n \"value\": [ \n {\n \"empid\": 4711,\n \"address\": {\n \"zipcode\": \"10022\", \n \"street\": \"ABC st\"\n }\n },\n ...\n ]\n}\n```\n ", "@Core.Links": [ { "rel": "alternate", diff --git a/vocabularies/Org.OData.JSON.V1.md b/vocabularies/Org.OData.JSON.V1.md index f1f8a667..ddf60902 100644 --- a/vocabularies/Org.OData.JSON.V1.md +++ b/vocabularies/Org.OData.JSON.V1.md @@ -12,19 +12,7 @@ In addition it defines two functions for [querying](#query) JSON data and using **Example** -The `Employees` entity set has a JSON data property `resume`: -```json -"container": { - "$Kind": "EntityContainer", - "Employees": { "$Collection": true, "$Type": "this.Employee" } -}, -"Employee": { - "$Kind": "EntityType", - "$Key": ["empid"], - "empid": { "$Type": "Edm.Int32" }, - "resume": { "$Type": "JSON.JSON", "$Nullable": true } -} -``` +The `Employees` entity set has a JSON data property `resume` (see [CSDL JSON](../examples/Org.OData.JSON.V1.Schema-sample.json) or [CSDL XML](../examples/Org.OData.JSON.V1.Schema-sample.xml)). One of its entities has a `resume` value of ```json @@ -70,13 +58,13 @@ receiving Term|Type|Description :---|:---|:---------- -[Schema](./Org.OData.JSON.V1.xml#L131:~:text=The JSON Schema for JSON values of the annotated media entity type, property, parameter, return type, term, or type definition
The schema can be a reference, i.e. `{"$ref":"url/of/schemafile#/path/to/schema/within/schemafile"}` +[Schema](./Org.OData.JSON.V1.xml#L119:~:text=The JSON Schema for JSON values of the annotated media entity type, property, parameter, return type, term, or type definition
The schema can be a reference, i.e. `{"$ref":"url/of/schemafile#/path/to/schema/within/schemafile"}` ## Functions -### [query](./Org.OData.JSON.V1.xml#L139:~:text= -### [value](./Org.OData.JSON.V1.xml#L162:~:text= -### [valueNumber](./Org.OData.JSON.V1.xml#L183:~:text= -### [valueBoolean](./Org.OData.JSON.V1.xml#L199:~:text= -## [JSON](./Org.OData.JSON.V1.xml#L216:~:text= -## [Path](./Org.OData.JSON.V1.xml#L227:~:text=