From 502b83e1fca5503e5a78a70016cd430b8a842f22 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Thu, 10 Oct 2024 10:54:29 +0200 Subject: [PATCH 1/6] New test case --- tools/tests/addressable-v2.openapi3.json | 731 +++++++++++++++++++++++ tools/tests/addressable-v2.xml | 114 ++++ 2 files changed, 845 insertions(+) create mode 100644 tools/tests/addressable-v2.openapi3.json create mode 100644 tools/tests/addressable-v2.xml diff --git a/tools/tests/addressable-v2.openapi3.json b/tools/tests/addressable-v2.openapi3.json new file mode 100644 index 00000000..d069a375 --- /dev/null +++ b/tools/tests/addressable-v2.openapi3.json @@ -0,0 +1,731 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Service for namespace ZE_API_DEMO_SRV", + "version": "", + "description": "This service is located at [https://localhost/service-root/](https://localhost/service-root/)\n\n## Entity Data Model\n![ER Diagram](https://yuml.me/diagram/class/[Head{bg:orange}],[Head]-*>[Address{bg:orange}],[Address{bg:orange}],[HeadSet{bg:dodgerblue}]++-*>[Head],[AddressSet{bg:dodgerblue}]++-*>[Address])\n\n### Legend\n![Legend](https://yuml.me/diagram/plain;dir:TB;scale:60/class/[External.Type{bg:whitesmoke}],[ComplexType],[EntityType{bg:orange}],[EntitySet/Singleton/Operation{bg:dodgerblue}])" + }, + "servers": [ + { + "url": "https://localhost/service-root" + } + ], + "tags": [ + { + "name": "HeadSet" + }, + { + "name": "AddressSet" + } + ], + "paths": { + "/HeadSet": { + "get": { + "summary": "Get entities from HeadSet", + "tags": [ + "HeadSet" + ], + "parameters": [ + { + "name": "$filter", + "in": "query", + "description": "Filter items by property values, see [Filtering](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=64)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=68)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "BusinessPartner", + "Type", + "Grouping", + "Title", + "FirstName", + "LastName", + "IsBlocked", + "ETag", + "to_Address" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=63)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "to_Address" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Wrapper", + "type": "object", + "properties": { + "d": { + "title": "Collection of Head", + "type": "object", + "properties": { + "__count": { + "$ref": "#/components/schemas/count" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Head" + } + } + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to HeadSet", + "tags": [ + "HeadSet" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Head-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "title": "Head", + "type": "object", + "properties": { + "d": { + "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Head" + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/HeadSet('{BusinessPartner}')": { + "parameters": [ + { + "name": "BusinessPartner", + "in": "path", + "required": true, + "description": "Geschäftspartnernummer", + "schema": { + "type": "string", + "maxLength": 10 + } + } + ], + "get": { + "summary": "Get entity from HeadSet by key", + "tags": [ + "HeadSet" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=68)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "BusinessPartner", + "Type", + "Grouping", + "Title", + "FirstName", + "LastName", + "IsBlocked", + "ETag", + "to_Address" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=63)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "to_Address" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "title": "Head", + "type": "object", + "properties": { + "d": { + "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Head" + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/HeadSet('{BusinessPartner}')/to_Address": { + "parameters": [ + { + "name": "BusinessPartner", + "in": "path", + "required": true, + "description": "Geschäftspartnernummer", + "schema": { + "type": "string", + "maxLength": 10 + } + } + ], + "get": { + "summary": "Get entities from related to_Address", + "tags": [ + "HeadSet", + "AddressSet" + ], + "parameters": [ + { + "name": "$filter", + "in": "query", + "description": "Filter items by property values, see [Filtering](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=64)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=68)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "BusinessPartner", + "AddressId", + "District", + "Street", + "HouseNumber", + "PostalCode", + "City", + "Country", + "ETag" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Wrapper", + "type": "object", + "properties": { + "d": { + "title": "Collection of Address", + "type": "object", + "properties": { + "__count": { + "$ref": "#/components/schemas/count" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Address" + } + } + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to related to_Address", + "tags": [ + "HeadSet", + "AddressSet" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Address-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "title": "Address", + "type": "object", + "properties": { + "d": { + "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Address" + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/AddressSet": { + "post": { + "summary": "Add new entity to AddressSet", + "tags": [ + "AddressSet" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Address-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "title": "Address", + "type": "object", + "properties": { + "d": { + "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Address" + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/$batch": { + "post": { + "summary": "Send a group of requests", + "description": "Group multiple requests into a single request payload, see [Batch Requests](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=152).\n\n*Please note that \"Try it out\" is not supported for this request.*", + "tags": [ + "Batch Requests" + ], + "requestBody": { + "required": true, + "description": "Batch request", + "content": { + "multipart/mixed;boundary=request-separator": { + "schema": { + "type": "string" + }, + "example": "--request-separator\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET HeadSet HTTP/1.1\nAccept: application/json\n\n\n--request-separator--" + } + } + }, + "responses": { + "202": { + "description": "Batch response", + "content": { + "multipart/mixed": { + "schema": { + "type": "string" + }, + "example": "--response-separator\nContent-Type: application/http\n\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{...}\n--response-separator--" + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + } + }, + "components": { + "schemas": { + "ZE_API_DEMO_SRV.Head": { + "type": "object", + "properties": { + "BusinessPartner": { + "type": "string", + "maxLength": 10, + "title": "GeschPartner", + "description": "Geschäftspartnernummer" + }, + "Type": { + "type": "string", + "maxLength": 4, + "title": "Partnerart", + "description": "Geschäftspartnerart" + }, + "Grouping": { + "type": "string", + "maxLength": 4, + "title": "Gruppierung", + "description": "Geschäftspartnergruppierung" + }, + "Title": { + "type": "string", + "maxLength": 4, + "title": "Anrede", + "description": "Anredeschlüssel" + }, + "FirstName": { + "type": "string", + "maxLength": 40, + "title": "Vorname", + "description": "Vorname des Geschäftspartners (Person)" + }, + "LastName": { + "type": "string", + "maxLength": 40, + "title": "Nachname", + "description": "Nachname des Geschäftspartners (Person)" + }, + "IsBlocked": { + "type": "boolean", + "title": "Zentrale Sperre", + "description": "Zentrale Sperre für den Geschäftspartner" + }, + "ETag": { + "type": "string", + "maxLength": 40, + "title": "Hash-Wert", + "description": "Hash-Wert (160 Bits)" + }, + "to_Address": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Address" + } + } + } + } + }, + "title": "Head" + }, + "ZE_API_DEMO_SRV.Head-create": { + "type": "object", + "properties": { + "Title": { + "type": "string", + "maxLength": 4, + "title": "Anrede", + "description": "Anredeschlüssel" + }, + "FirstName": { + "type": "string", + "maxLength": 40, + "title": "Vorname", + "description": "Vorname des Geschäftspartners (Person)" + }, + "LastName": { + "type": "string", + "maxLength": 40, + "title": "Nachname", + "description": "Nachname des Geschäftspartners (Person)" + }, + "to_Address": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Address-create" + } + } + } + } + }, + "title": "Head (for create)" + }, + "ZE_API_DEMO_SRV.Head-update": { + "type": "object", + "title": "Head (for update)" + }, + "ZE_API_DEMO_SRV.Address": { + "type": "object", + "properties": { + "BusinessPartner": { + "type": "string", + "maxLength": 10, + "title": "GeschPartner", + "description": "Geschäftspartnernummer" + }, + "AddressId": { + "type": "string", + "maxLength": 10, + "title": "Adressnummer" + }, + "District": { + "type": "string", + "maxLength": 40, + "title": "Ortsteil" + }, + "Street": { + "type": "string", + "maxLength": 60, + "title": "Straße" + }, + "HouseNumber": { + "type": "string", + "maxLength": 10, + "title": "Hausnummer" + }, + "PostalCode": { + "type": "string", + "maxLength": 10, + "title": "Postleitzahl", + "description": "Postleitzahl des Orts" + }, + "City": { + "type": "string", + "maxLength": 40, + "title": "Ort" + }, + "Country": { + "type": "string", + "maxLength": 2, + "title": "ISO-Code", + "description": "ISO-Code des Landes" + }, + "ETag": { + "type": "string", + "maxLength": 40, + "title": "Hash-Wert", + "description": "Hash-Wert (160 Bits)" + } + }, + "title": "Address" + }, + "ZE_API_DEMO_SRV.Address-create": { + "type": "object", + "properties": { + "District": { + "type": "string", + "maxLength": 40, + "title": "Ortsteil" + }, + "Street": { + "type": "string", + "maxLength": 60, + "title": "Straße" + }, + "HouseNumber": { + "type": "string", + "maxLength": 10, + "title": "Hausnummer" + }, + "PostalCode": { + "type": "string", + "maxLength": 10, + "title": "Postleitzahl", + "description": "Postleitzahl des Orts" + }, + "City": { + "type": "string", + "maxLength": 40, + "title": "Ort" + } + }, + "title": "Address (for create)" + }, + "ZE_API_DEMO_SRV.Address-update": { + "type": "object", + "title": "Address (for update)" + }, + "count": { + "type": "string", + "description": "The number of entities in the collection. Available when using the [$inlinecount](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=67) query option." + }, + "error": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "object", + "required": [ + "lang", + "value" + ], + "properties": { + "lang": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "innererror": { + "type": "object", + "description": "The structure of this object is service-specific" + } + } + } + } + } + }, + "parameters": { + "top": { + "name": "$top", + "in": "query", + "description": "Show only the first n items, see [Paging - Top](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=66)", + "schema": { + "type": "integer", + "minimum": 0 + }, + "example": 50 + }, + "skip": { + "name": "$skip", + "in": "query", + "description": "Skip the first n items, see [Paging - Skip](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=65)", + "schema": { + "type": "integer", + "minimum": 0 + } + }, + "count": { + "name": "$inlinecount", + "in": "query", + "description": "Include count of items, see [Inlinecount](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=67)", + "schema": { + "type": "string", + "enum": [ + "allpages", + "none" + ] + } + } + }, + "responses": { + "error": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/tools/tests/addressable-v2.xml b/tools/tests/addressable-v2.xml new file mode 100644 index 00000000..970c638e --- /dev/null +++ b/tools/tests/addressable-v2.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 97446e9798037d500573a1892282ee31c94f3512 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Thu, 10 Oct 2024 10:58:02 +0200 Subject: [PATCH 2/6] Update addressable-v2.xml --- tools/tests/addressable-v2.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/tests/addressable-v2.xml b/tools/tests/addressable-v2.xml index 970c638e..009e4898 100644 --- a/tools/tests/addressable-v2.xml +++ b/tools/tests/addressable-v2.xml @@ -15,15 +15,15 @@ + sap:sortable="false" sap:filterable="false" /> + sap:updatable="false" sap:sortable="false" sap:filterable="false" /> + sap:filterable="false" /> + sap:updatable="false" sap:sortable="false" sap:filterable="false" /> + sap:updatable="false" sap:sortable="false" sap:filterable="false" /> + sap:filterable="false" /> + sap:sortable="false" sap:filterable="false" /> + sap:sortable="false" sap:filterable="false" /> + sap:sortable="false" sap:filterable="false" /> + sap:filterable="false" /> + sap:filterable="false" /> + sap:filterable="false" /> Date: Thu, 10 Oct 2024 11:32:23 +0200 Subject: [PATCH 3/6] No direct create for non-addressable entity sets --- tools/V2-to-V4-CSDL.xsl | 18 +++++++++++ tools/tests/addressable-v2.openapi3.json | 40 ------------------------ 2 files changed, 18 insertions(+), 40 deletions(-) diff --git a/tools/V2-to-V4-CSDL.xsl b/tools/V2-to-V4-CSDL.xsl index 3dc61f19..8922d4a0 100644 --- a/tools/V2-to-V4-CSDL.xsl +++ b/tools/V2-to-V4-CSDL.xsl @@ -466,6 +466,15 @@ + + + + + true + + + + @@ -1032,6 +1041,15 @@ + + + + .InsertRestrictions + + + + + diff --git a/tools/tests/addressable-v2.openapi3.json b/tools/tests/addressable-v2.openapi3.json index d069a375..30a6b440 100644 --- a/tools/tests/addressable-v2.openapi3.json +++ b/tools/tests/addressable-v2.openapi3.json @@ -364,46 +364,6 @@ } } }, - "/AddressSet": { - "post": { - "summary": "Add new entity to AddressSet", - "tags": [ - "AddressSet" - ], - "requestBody": { - "required": true, - "description": "New entity", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Address-create" - } - } - } - }, - "responses": { - "201": { - "description": "Created entity", - "content": { - "application/json": { - "schema": { - "title": "Address", - "type": "object", - "properties": { - "d": { - "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Address" - } - } - } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, "/$batch": { "post": { "summary": "Send a group of requests", From 4e886bc56372e67228feadf3baf0ade67be00c9d Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Thu, 10 Oct 2024 11:57:24 +0200 Subject: [PATCH 4/6] No root paths for non-addressable entity sets --- tools/V2-to-V4-CSDL.xsl | 18 ++++++++++++++++++ tools/tests/addressable-v2.xml | 4 +--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/tools/V2-to-V4-CSDL.xsl b/tools/V2-to-V4-CSDL.xsl index 8922d4a0..df33d91c 100644 --- a/tools/V2-to-V4-CSDL.xsl +++ b/tools/V2-to-V4-CSDL.xsl @@ -1050,6 +1050,24 @@ + + + + .UpdateRestrictions + + + + + + + + + .DeleteRestrictions + + + + + diff --git a/tools/tests/addressable-v2.xml b/tools/tests/addressable-v2.xml index 009e4898..14ef762e 100644 --- a/tools/tests/addressable-v2.xml +++ b/tools/tests/addressable-v2.xml @@ -99,11 +99,9 @@ sap:supported-formats="atom json xlsx"> - From c0f90b28112b6f6545e2af7152c15a4e2afa0fcc Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Thu, 17 Oct 2024 13:38:15 +0200 Subject: [PATCH 5/6] PATCH and DELETE for addressable=false --- tools/V2-to-V4-CSDL.xsl | 18 - tools/tests/addressable-v2.openapi3.json | 69 +++ tools/tests/addressable-v2.swagger.json | 700 +++++++++++++++++++++++ 3 files changed, 769 insertions(+), 18 deletions(-) create mode 100644 tools/tests/addressable-v2.swagger.json diff --git a/tools/V2-to-V4-CSDL.xsl b/tools/V2-to-V4-CSDL.xsl index df33d91c..8922d4a0 100644 --- a/tools/V2-to-V4-CSDL.xsl +++ b/tools/V2-to-V4-CSDL.xsl @@ -1050,24 +1050,6 @@ - - - - .UpdateRestrictions - - - - - - - - - .DeleteRestrictions - - - - - diff --git a/tools/tests/addressable-v2.openapi3.json b/tools/tests/addressable-v2.openapi3.json index 30a6b440..82cbee47 100644 --- a/tools/tests/addressable-v2.openapi3.json +++ b/tools/tests/addressable-v2.openapi3.json @@ -364,6 +364,75 @@ } } }, + "/AddressSet(BusinessPartner='{BusinessPartner}',AddressId='{AddressId}')": { + "parameters": [ + { + "name": "BusinessPartner", + "in": "path", + "required": true, + "description": "Geschäftspartnernummer", + "schema": { + "type": "string", + "maxLength": 10 + } + }, + { + "name": "AddressId", + "in": "path", + "required": true, + "description": "Adressnummer", + "schema": { + "type": "string", + "maxLength": 10 + } + } + ], + "patch": { + "summary": "Update entity in AddressSet", + "tags": [ + "AddressSet" + ], + "requestBody": { + "required": true, + "description": "New property values", + "content": { + "application/json": { + "schema": { + "title": "Modified Address", + "type": "object", + "properties": { + "d": { + "$ref": "#/components/schemas/ZE_API_DEMO_SRV.Address-update" + } + } + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from AddressSet", + "tags": [ + "AddressSet" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, "/$batch": { "post": { "summary": "Send a group of requests", diff --git a/tools/tests/addressable-v2.swagger.json b/tools/tests/addressable-v2.swagger.json new file mode 100644 index 00000000..0c07e99a --- /dev/null +++ b/tools/tests/addressable-v2.swagger.json @@ -0,0 +1,700 @@ +{ + "swagger": "2.0", + "info": { + "title": "Service for namespace ZE_API_DEMO_SRV", + "version": "", + "description": "This service is located at [https://localhost/service-root/](https://localhost/service-root/)\n\n## Entity Data Model\n![ER Diagram](https://yuml.me/diagram/class/[Head{bg:orange}],[Head]-*>[Address{bg:orange}],[Address{bg:orange}],[HeadSet{bg:dodgerblue}]++-*>[Head],[AddressSet{bg:dodgerblue}]++-*>[Address])\n\n### Legend\n![Legend](https://yuml.me/diagram/plain;dir:TB;scale:60/class/[External.Type{bg:whitesmoke}],[ComplexType],[EntityType{bg:orange}],[EntitySet/Singleton/Operation{bg:dodgerblue}])" + }, + "schemes": [ + "https" + ], + "host": "localhost", + "basePath": "/service-root", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + { + "name": "HeadSet" + }, + { + "name": "AddressSet" + } + ], + "paths": { + "/HeadSet": { + "get": { + "summary": "Get entities from HeadSet", + "tags": [ + "HeadSet" + ], + "parameters": [ + { + "name": "$filter", + "in": "query", + "description": "Filter items by property values, see [Filtering](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=64)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=68)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "BusinessPartner", + "Type", + "Grouping", + "Title", + "FirstName", + "LastName", + "IsBlocked", + "ETag", + "to_Address" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=63)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "to_Address" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Wrapper", + "type": "object", + "properties": { + "d": { + "title": "Collection of Head", + "type": "object", + "properties": { + "__count": { + "$ref": "#/definitions/count" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ZE_API_DEMO_SRV.Head" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to HeadSet", + "tags": [ + "HeadSet" + ], + "parameters": [ + { + "name": "Head", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/ZE_API_DEMO_SRV.Head-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "title": "Head", + "type": "object", + "properties": { + "d": { + "$ref": "#/definitions/ZE_API_DEMO_SRV.Head" + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/HeadSet('{BusinessPartner}')": { + "parameters": [ + { + "name": "BusinessPartner", + "in": "path", + "required": true, + "description": "Geschäftspartnernummer", + "type": "string" + } + ], + "get": { + "summary": "Get entity from HeadSet by key", + "tags": [ + "HeadSet" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=68)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "BusinessPartner", + "Type", + "Grouping", + "Title", + "FirstName", + "LastName", + "IsBlocked", + "ETag", + "to_Address" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=63)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "to_Address" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "title": "Head", + "type": "object", + "properties": { + "d": { + "$ref": "#/definitions/ZE_API_DEMO_SRV.Head" + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/HeadSet('{BusinessPartner}')/to_Address": { + "parameters": [ + { + "name": "BusinessPartner", + "in": "path", + "required": true, + "description": "Geschäftspartnernummer", + "type": "string" + } + ], + "get": { + "summary": "Get entities from related to_Address", + "tags": [ + "HeadSet", + "AddressSet" + ], + "parameters": [ + { + "name": "$filter", + "in": "query", + "description": "Filter items by property values, see [Filtering](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=64)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=68)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "BusinessPartner", + "AddressId", + "District", + "Street", + "HouseNumber", + "PostalCode", + "City", + "Country", + "ETag" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Wrapper", + "type": "object", + "properties": { + "d": { + "title": "Collection of Address", + "type": "object", + "properties": { + "__count": { + "$ref": "#/definitions/count" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ZE_API_DEMO_SRV.Address" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to related to_Address", + "tags": [ + "HeadSet", + "AddressSet" + ], + "parameters": [ + { + "name": "Address", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/ZE_API_DEMO_SRV.Address-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "title": "Address", + "type": "object", + "properties": { + "d": { + "$ref": "#/definitions/ZE_API_DEMO_SRV.Address" + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/AddressSet(BusinessPartner='{BusinessPartner}',AddressId='{AddressId}')": { + "parameters": [ + { + "name": "BusinessPartner", + "in": "path", + "required": true, + "description": "Geschäftspartnernummer", + "type": "string" + }, + { + "name": "AddressId", + "in": "path", + "required": true, + "description": "Adressnummer", + "type": "string" + } + ], + "patch": { + "summary": "Update entity in AddressSet", + "tags": [ + "AddressSet" + ], + "parameters": [ + { + "name": "Address", + "in": "body", + "description": "New property values", + "schema": { + "title": "Modified Address", + "type": "object", + "properties": { + "d": { + "$ref": "#/definitions/ZE_API_DEMO_SRV.Address-update" + } + } + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from AddressSet", + "tags": [ + "AddressSet" + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/$batch": { + "post": { + "summary": "Send a group of requests", + "description": "Group multiple requests into a single request payload, see [Batch Requests](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=152).", + "tags": [ + "Batch Requests" + ], + "consumes": [ + "multipart/mixed;boundary=request-separator" + ], + "produces": [ + "multipart/mixed" + ], + "parameters": [ + { + "name": "requestBody", + "in": "body", + "description": "Batch request", + "schema": { + "type": "string", + "example": "--request-separator\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET HeadSet HTTP/1.1\nAccept: application/json\n\n\n--request-separator--" + } + } + ], + "responses": { + "202": { + "description": "Batch response", + "schema": { + "type": "string", + "example": "--response-separator\nContent-Type: application/http\n\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{...}\n--response-separator--" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + } + }, + "definitions": { + "ZE_API_DEMO_SRV.Head": { + "type": "object", + "properties": { + "BusinessPartner": { + "type": "string", + "maxLength": 10, + "title": "GeschPartner", + "description": "Geschäftspartnernummer" + }, + "Type": { + "type": "string", + "maxLength": 4, + "title": "Partnerart", + "description": "Geschäftspartnerart" + }, + "Grouping": { + "type": "string", + "maxLength": 4, + "title": "Gruppierung", + "description": "Geschäftspartnergruppierung" + }, + "Title": { + "type": "string", + "maxLength": 4, + "title": "Anrede", + "description": "Anredeschlüssel" + }, + "FirstName": { + "type": "string", + "maxLength": 40, + "title": "Vorname", + "description": "Vorname des Geschäftspartners (Person)" + }, + "LastName": { + "type": "string", + "maxLength": 40, + "title": "Nachname", + "description": "Nachname des Geschäftspartners (Person)" + }, + "IsBlocked": { + "type": "boolean", + "title": "Zentrale Sperre", + "description": "Zentrale Sperre für den Geschäftspartner" + }, + "ETag": { + "type": "string", + "maxLength": 40, + "title": "Hash-Wert", + "description": "Hash-Wert (160 Bits)" + }, + "to_Address": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ZE_API_DEMO_SRV.Address" + } + } + } + } + }, + "title": "Head" + }, + "ZE_API_DEMO_SRV.Head-create": { + "type": "object", + "properties": { + "Title": { + "type": "string", + "maxLength": 4, + "title": "Anrede", + "description": "Anredeschlüssel" + }, + "FirstName": { + "type": "string", + "maxLength": 40, + "title": "Vorname", + "description": "Vorname des Geschäftspartners (Person)" + }, + "LastName": { + "type": "string", + "maxLength": 40, + "title": "Nachname", + "description": "Nachname des Geschäftspartners (Person)" + }, + "to_Address": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ZE_API_DEMO_SRV.Address-create" + } + } + } + } + }, + "title": "Head (for create)" + }, + "ZE_API_DEMO_SRV.Head-update": { + "type": "object", + "title": "Head (for update)" + }, + "ZE_API_DEMO_SRV.Address": { + "type": "object", + "properties": { + "BusinessPartner": { + "type": "string", + "maxLength": 10, + "title": "GeschPartner", + "description": "Geschäftspartnernummer" + }, + "AddressId": { + "type": "string", + "maxLength": 10, + "title": "Adressnummer" + }, + "District": { + "type": "string", + "maxLength": 40, + "title": "Ortsteil" + }, + "Street": { + "type": "string", + "maxLength": 60, + "title": "Straße" + }, + "HouseNumber": { + "type": "string", + "maxLength": 10, + "title": "Hausnummer" + }, + "PostalCode": { + "type": "string", + "maxLength": 10, + "title": "Postleitzahl", + "description": "Postleitzahl des Orts" + }, + "City": { + "type": "string", + "maxLength": 40, + "title": "Ort" + }, + "Country": { + "type": "string", + "maxLength": 2, + "title": "ISO-Code", + "description": "ISO-Code des Landes" + }, + "ETag": { + "type": "string", + "maxLength": 40, + "title": "Hash-Wert", + "description": "Hash-Wert (160 Bits)" + } + }, + "title": "Address" + }, + "ZE_API_DEMO_SRV.Address-create": { + "type": "object", + "properties": { + "District": { + "type": "string", + "maxLength": 40, + "title": "Ortsteil" + }, + "Street": { + "type": "string", + "maxLength": 60, + "title": "Straße" + }, + "HouseNumber": { + "type": "string", + "maxLength": 10, + "title": "Hausnummer" + }, + "PostalCode": { + "type": "string", + "maxLength": 10, + "title": "Postleitzahl", + "description": "Postleitzahl des Orts" + }, + "City": { + "type": "string", + "maxLength": 40, + "title": "Ort" + } + }, + "title": "Address (for create)" + }, + "ZE_API_DEMO_SRV.Address-update": { + "type": "object", + "title": "Address (for update)" + }, + "count": { + "type": "string", + "description": "The number of entities in the collection. Available when using the [$inlinecount](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=67) query option." + }, + "error": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "object", + "required": [ + "lang", + "value" + ], + "properties": { + "lang": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "innererror": { + "type": "object", + "description": "The structure of this object is service-specific" + } + } + } + } + } + }, + "parameters": { + "top": { + "name": "$top", + "in": "query", + "description": "Show only the first n items, see [Paging - Top](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=66)", + "type": "integer", + "minimum": 0 + }, + "skip": { + "name": "$skip", + "in": "query", + "description": "Skip the first n items, see [Paging - Skip](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=65)", + "type": "integer", + "minimum": 0 + }, + "count": { + "name": "$inlinecount", + "in": "query", + "description": "Include count of items, see [Inlinecount](https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=67)", + "type": "string", + "enum": [ + "allpages", + "none" + ] + } + }, + "responses": { + "error": { + "description": "Error", + "schema": { + "$ref": "#/definitions/error" + } + } + } +} \ No newline at end of file From 9a22e3121b081f1b281edd018767491ce98d09df Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Fri, 18 Oct 2024 16:54:49 +0200 Subject: [PATCH 6/6] Remove undocumented V2 annotation It doesn't work, and it is not documented --- tools/V2-to-V4-CSDL.xsl | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/V2-to-V4-CSDL.xsl b/tools/V2-to-V4-CSDL.xsl index 8922d4a0..040c2a9a 100644 --- a/tools/V2-to-V4-CSDL.xsl +++ b/tools/V2-to-V4-CSDL.xsl @@ -1210,12 +1210,6 @@ - - - - - -