diff --git a/tools/V4-CSDL-to-OpenAPI.xsl b/tools/V4-CSDL-to-OpenAPI.xsl index 0c60fcf8..df33bf36 100644 --- a/tools/V4-CSDL-to-OpenAPI.xsl +++ b/tools/V4-CSDL-to-OpenAPI.xsl @@ -1,5 +1,9 @@ - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - + @@ -377,7 +274,6 @@ - @@ -386,7 +282,6 @@ - @@ -395,7 +290,6 @@ - @@ -404,7 +298,6 @@ - @@ -461,7 +354,6 @@ - @@ -689,7 +581,7 @@ } - + ,"search":{"name":"search","in":"query","description":"Search items by search phrases , see [Searching](https://wiki.scn.sap.com/wiki/display/EmTech/SAP+Annotations+for+OData+Version+2.0#SAPAnnotationsforODataVersion2.0-Query_Option_searchQueryOptionsearch)", @@ -725,13 +617,8 @@ - - - - - - - + ," @@ -960,11 +847,8 @@ - - - - - + ,"security":[ @@ -1487,30 +1371,6 @@ - - - - - - - - - - - - - - - - - @@ -1528,9 +1388,15 @@ - + @@ -1538,8 +1404,12 @@ - + @@ -1555,11 +1425,41 @@ + - + + + + , + + " + + " + + + + + @Name=$navigation-restrictions/edm:PropertyValue[@Property='UpdateRestrictions'] + /edm:Record/edm:PropertyValue[@Property='RequiredProperties']/edm:Collection/edm:PropertyPath or + not($navigation-restrictions/edm:PropertyValue[@Property='UpdateRestrictions']) and + @Name=//edm:Annotation[not(@Qualifier) and @p2:Term='Org.OData.Capabilities.V1.UpdateRestrictions' and + id(@target)/@p1:EntityType=$structuredType/@id] + /edm:Record/edm:PropertyValue[@Property='RequiredProperties']/edm:Collection/edm:PropertyPath]"> , @@ -2558,21 +2458,10 @@ - - - - - - - - - - - - - + "/$batch":{ - + "post":{"summary": "Send a group of requests","description": "Group multiple requests into a single request payload, see [Batch Requests]( @@ -2736,137 +2625,89 @@ - - - - - - - - - - - - - - + + - - - - - - + + + - + + + - - - - - - + + - - - + - + - + + + - - - - - - - - - - - - + + + - - - - - - + - - - - - - - - - - - - - - + + + + - - - - - - - - - - - + + + + - - - - - - - - - - @@ -2875,83 +2716,59 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + - + + + - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + \n\nRequired filter properties: @@ -2961,45 +2778,6 @@ - - - - - , - - {"name":" - - orderby","in":"query","description":"Order items by property values, see [Sorting]( - - - https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=65 - - - http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby - - - )", - - "explode":false,"schema":{ - - "type":"array","uniqueItems":true,"items":{"type":"string","enum":[ - - - , - - " - - "," - - desc" - - ]}} - - } - - - - @@ -3078,55 +2856,23 @@ + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . - - - - + . - + - - Collection( @@ -3136,18 +2882,20 @@ ) - - - Collection( - - - - ) - - + + + + + + + + "/ ":{ @@ -3165,7 +2913,10 @@ "get":{ - + Get @@ -3180,24 +2931,21 @@ - + ,"parameters":[ - - + + ] - - - - - - + @@ -3226,7 +2974,10 @@ "post":{ - + @@ -3245,13 +2996,13 @@ - + ,"parameters":[{"name":" - + ","in":"body", @@ -3317,12 +3068,14 @@ }, - + - + @@ -3377,78 +3130,61 @@ - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . - - - - + . - + - - - - + + + + + - - - + - + - - - - - + + + + @@ -3472,7 +3208,7 @@ - + "/ @@ -3514,37 +3250,35 @@ ,"parameters":[ - - - - - - - + + - - + - + - + - - - + - - + + @@ -3560,7 +3294,7 @@ - + , @@ -3590,7 +3324,7 @@ "parameters":[{"name":" - + ","in":"body", @@ -3607,7 +3341,7 @@ "schema":{ "title":"Modified - + ","type":"object","properties":{"d":{ @@ -3642,8 +3376,8 @@ - - + + , "delete":{ @@ -3727,12 +3461,12 @@ - + - + @@ -3740,9 +3474,9 @@ + - @@ -4256,65 +3990,60 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - + + + + - + - - - + @@ -4359,7 +4088,7 @@ ) - + ", @@ -4383,15 +4112,51 @@ - - - - - - - - + + + + ," + + "," + + desc" + + + + + + , + + {"name":" + + orderby","in":"query","description":"Order items by property values, see [Sorting]( + + + https://help.sap.com/doc/5890d27be418427993fafa6722cdc03b/Cloud/en-US/OdataV2.pdf#page=65 + + + http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby + + + )", + + "explode":false,"schema":{ + + "type":"array","uniqueItems":true,"items":{"type":"string","enum":[ + + ]}} + + } + + + @@ -4416,7 +4181,7 @@ - + @@ -4497,7 +4262,7 @@ ":{ - + "allOf":[{ @@ -4521,7 +4286,7 @@ }] - + }, {"properties":{ diff --git a/tools/csdl-ext.dtd b/tools/csdl-ext.dtd new file mode 100644 index 00000000..f0c95c0d --- /dev/null +++ b/tools/csdl-ext.dtd @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/resolve-paths.xsl b/tools/resolve-paths.xsl new file mode 100644 index 00000000..291fa863 --- /dev/null +++ b/tools/resolve-paths.xsl @@ -0,0 +1,781 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Invalid + + @ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Collection( + + + + ) + + + + + + + + + + + + + + + Edm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/tests/annotations-v4.openapi3.json b/tools/tests/annotations-v4.openapi3.json new file mode 100644 index 00000000..1b77a5c2 --- /dev/null +++ b/tools/tests/annotations-v4.openapi3.json @@ -0,0 +1,1005 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Service for namespace Resolved.Paths", + "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/[Order{bg:orange}],[Order]-*>[OrderItem{bg:orange}],[OrderItem{bg:orange}],[OrderItem]-0..1>[Order{bg:orange}],[Orders{bg:dodgerblue}]++-*>[Order],[OrderItems{bg:dodgerblue}]++-*>[OrderItem])\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": "Orders" + }, + { + "name": "OrderItems" + } + ], + "paths": { + "/Orders": { + "get": { + "summary": "Get entities from Orders", + "tags": [ + "Orders" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "in": "query", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Unit", + "Unit desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Unit" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Items" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of Order", + "type": "object", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Resolved.Paths.Order" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to Orders", + "tags": [ + "Orders" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Resolved.Paths.Order-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Resolved.Paths.Order" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Orders('{ID}')": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Get entity from Orders by key", + "tags": [ + "Orders" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Unit" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Items" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Resolved.Paths.Order" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in Orders", + "tags": [ + "Orders" + ], + "requestBody": { + "required": true, + "description": "New property values", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Resolved.Paths.Order-update" + } + } + } + }, + "responses": { + "200": { + "description": "Updated entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Resolved.Paths.Order" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from Orders", + "tags": [ + "Orders" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Orders('{ID}')/Items": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Get entities from related Items", + "tags": [ + "Orders" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "in": "query", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Text", + "Text desc", + "Quantity", + "Quantity desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Text", + "Quantity" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Header" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of OrderItem", + "type": "object", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Resolved.Paths.OrderItem" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/OrderItems": { + "get": { + "summary": "Get entities from OrderItems", + "tags": [ + "OrderItems" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "in": "query", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Text", + "Text desc", + "Quantity", + "Quantity desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Text", + "Quantity" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Header" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of OrderItem", + "type": "object", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Resolved.Paths.OrderItem" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to OrderItems", + "tags": [ + "OrderItems" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Resolved.Paths.OrderItem-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Resolved.Paths.OrderItem" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/OrderItems('{ID}')": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Get entity from OrderItems by key", + "tags": [ + "OrderItems" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Text", + "Quantity" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Header" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Resolved.Paths.OrderItem" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in OrderItems", + "tags": [ + "OrderItems" + ], + "requestBody": { + "required": true, + "description": "New property values", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Resolved.Paths.OrderItem-update" + } + } + } + }, + "responses": { + "200": { + "description": "Updated entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Resolved.Paths.OrderItem" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from OrderItems", + "tags": [ + "OrderItems" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/OrderItems('{ID}')/Header": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Get related Header", + "tags": [ + "OrderItems" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Unit" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Items" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Resolved.Paths.Order" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/$batch": {} + }, + "components": { + "schemas": { + "Resolved.Paths.Order": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "nullable": true + }, + "Unit": { + "type": "string", + "nullable": true + }, + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Resolved.Paths.OrderItem" + }, + "title": "contained entity set" + } + }, + "title": "Order" + }, + "Resolved.Paths.Order-create": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "nullable": true + }, + "Unit": { + "type": "string", + "nullable": true + }, + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Resolved.Paths.OrderItem-create" + }, + "title": "contained entity set" + } + }, + "required": [ + "ID" + ], + "title": "Order (for create)" + }, + "Resolved.Paths.Order-update": { + "type": "object", + "properties": { + "Unit": { + "type": "string", + "nullable": true + } + }, + "title": "Order (for update)" + }, + "Resolved.Paths.OrderItem": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Text": { + "type": "string", + "nullable": true + }, + "Quantity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "nullable": true, + "format": "decimal", + "multipleOf": 1, + "example": 0 + }, + "Header": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/Resolved.Paths.Order" + } + ] + } + }, + "title": "OrderItem" + }, + "Resolved.Paths.OrderItem-create": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Text": { + "type": "string", + "nullable": true + }, + "Quantity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "nullable": true, + "format": "decimal", + "multipleOf": 1, + "example": 0 + }, + "Header": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/Resolved.Paths.Order-create" + } + ] + } + }, + "required": [ + "ID" + ], + "title": "OrderItem (for create)" + }, + "Resolved.Paths.OrderItem-update": { + "type": "object", + "properties": { + "Text": { + "type": "string", + "nullable": true + }, + "Quantity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "nullable": true, + "format": "decimal", + "multipleOf": 1, + "example": 0 + } + }, + "title": "OrderItem (for update)" + }, + "count": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." + }, + "error": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "target": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "target": { + "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](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptiontop)", + "schema": { + "type": "integer", + "minimum": 0 + }, + "example": 50 + }, + "skip": { + "name": "$skip", + "in": "query", + "description": "Skip the first n items, see [Paging - Skip](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionskip)", + "schema": { + "type": "integer", + "minimum": 0 + } + }, + "count": { + "name": "$count", + "in": "query", + "description": "Include count of items, see [Count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount)", + "schema": { + "type": "boolean" + } + }, + "search": { + "name": "$search", + "in": "query", + "description": "Search items by search phrases, see [Searching](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionsearch)", + "schema": { + "type": "string" + } + } + }, + "responses": { + "error": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + } + } + } + } +} diff --git a/tools/tests/annotations-v4.swagger.json b/tools/tests/annotations-v4.swagger.json new file mode 100644 index 00000000..ab913ee7 --- /dev/null +++ b/tools/tests/annotations-v4.swagger.json @@ -0,0 +1,923 @@ +{ + "swagger": "2.0", + "info": { + "title": "Service for namespace Resolved.Paths", + "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/[Order{bg:orange}],[Order]-*>[OrderItem{bg:orange}],[OrderItem{bg:orange}],[OrderItem]-0..1>[Order{bg:orange}],[Orders{bg:dodgerblue}]++-*>[Order],[OrderItems{bg:dodgerblue}]++-*>[OrderItem])\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": "Orders" + }, + { + "name": "OrderItems" + } + ], + "paths": { + "/Orders": { + "get": { + "summary": "Get entities from Orders", + "tags": [ + "Orders" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "$ref": "#/parameters/search" + }, + { + "name": "$filter", + "in": "query", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Unit", + "Unit desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Unit" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Items" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of Order", + "type": "object", + "properties": { + "@odata.count": { + "$ref": "#/definitions/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Resolved.Paths.Order" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to Orders", + "tags": [ + "Orders" + ], + "parameters": [ + { + "name": "Order", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/Resolved.Paths.Order-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "$ref": "#/definitions/Resolved.Paths.Order" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Orders('{ID}')": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "string" + } + ], + "get": { + "summary": "Get entity from Orders by key", + "tags": [ + "Orders" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Unit" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Items" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/Resolved.Paths.Order" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in Orders", + "tags": [ + "Orders" + ], + "parameters": [ + { + "name": "Order", + "in": "body", + "description": "New property values", + "schema": { + "$ref": "#/definitions/Resolved.Paths.Order-update" + } + } + ], + "responses": { + "200": { + "description": "Updated entity", + "schema": { + "$ref": "#/definitions/Resolved.Paths.Order" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from Orders", + "tags": [ + "Orders" + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Orders('{ID}')/Items": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "string" + } + ], + "get": { + "summary": "Get entities from related Items", + "tags": [ + "Orders" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "$ref": "#/parameters/search" + }, + { + "name": "$filter", + "in": "query", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Text", + "Text desc", + "Quantity", + "Quantity desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Text", + "Quantity" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Header" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of OrderItem", + "type": "object", + "properties": { + "@odata.count": { + "$ref": "#/definitions/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Resolved.Paths.OrderItem" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/OrderItems": { + "get": { + "summary": "Get entities from OrderItems", + "tags": [ + "OrderItems" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "$ref": "#/parameters/search" + }, + { + "name": "$filter", + "in": "query", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Text", + "Text desc", + "Quantity", + "Quantity desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Text", + "Quantity" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Header" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of OrderItem", + "type": "object", + "properties": { + "@odata.count": { + "$ref": "#/definitions/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Resolved.Paths.OrderItem" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to OrderItems", + "tags": [ + "OrderItems" + ], + "parameters": [ + { + "name": "OrderItem", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/Resolved.Paths.OrderItem-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "$ref": "#/definitions/Resolved.Paths.OrderItem" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/OrderItems('{ID}')": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "string" + } + ], + "get": { + "summary": "Get entity from OrderItems by key", + "tags": [ + "OrderItems" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Text", + "Quantity" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Header" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/Resolved.Paths.OrderItem" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in OrderItems", + "tags": [ + "OrderItems" + ], + "parameters": [ + { + "name": "OrderItem", + "in": "body", + "description": "New property values", + "schema": { + "$ref": "#/definitions/Resolved.Paths.OrderItem-update" + } + } + ], + "responses": { + "200": { + "description": "Updated entity", + "schema": { + "$ref": "#/definitions/Resolved.Paths.OrderItem" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from OrderItems", + "tags": [ + "OrderItems" + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/OrderItems('{ID}')/Header": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "string" + } + ], + "get": { + "summary": "Get related Header", + "tags": [ + "OrderItems" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Unit" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Items" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/Resolved.Paths.Order" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/$batch": { + "post": { + "summary": "Send a group of requests", + "description": "Group multiple requests into a single request payload, see [Batch Requests](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_BatchRequests).", + "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 Orders HTTP/1.1\nAccept: application/json\n\n\n--request-separator--" + } + } + ], + "responses": { + "200": { + "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": { + "Resolved.Paths.Order": { + "type": "object", + "properties": { + "ID": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Unit": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Resolved.Paths.OrderItem" + } + } + }, + "title": "Order" + }, + "Resolved.Paths.Order-create": { + "type": "object", + "properties": { + "ID": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Unit": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Resolved.Paths.OrderItem-create" + } + } + }, + "required": [ + "ID" + ], + "title": "Order (for create)" + }, + "Resolved.Paths.Order-update": { + "type": "object", + "properties": { + "Unit": { + "type": [ + "string", + "null" + ], + "example": "string" + } + }, + "title": "Order (for update)" + }, + "Resolved.Paths.OrderItem": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Text": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Quantity": { + "type": [ + "number", + "string", + "null" + ], + "format": "decimal", + "multipleOf": 1, + "example": 0 + }, + "Header": { + "$ref": "#/definitions/Resolved.Paths.Order" + } + }, + "title": "OrderItem" + }, + "Resolved.Paths.OrderItem-create": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Text": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Quantity": { + "type": [ + "number", + "string", + "null" + ], + "format": "decimal", + "multipleOf": 1, + "example": 0 + }, + "Header": { + "$ref": "#/definitions/Resolved.Paths.Order-create" + } + }, + "required": [ + "ID" + ], + "title": "OrderItem (for create)" + }, + "Resolved.Paths.OrderItem-update": { + "type": "object", + "properties": { + "Text": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Quantity": { + "type": [ + "number", + "string", + "null" + ], + "format": "decimal", + "multipleOf": 1, + "example": 0 + } + }, + "title": "OrderItem (for update)" + }, + "count": { + "type": "string", + "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." + }, + "error": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "target": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "target": { + "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](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptiontop)", + "type": "integer", + "minimum": 0 + }, + "skip": { + "name": "$skip", + "in": "query", + "description": "Skip the first n items, see [Paging - Skip](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionskip)", + "type": "integer", + "minimum": 0 + }, + "count": { + "name": "$count", + "in": "query", + "description": "Include count of items, see [Count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount)", + "type": "boolean" + }, + "search": { + "name": "$search", + "in": "query", + "description": "Search items by search phrases, see [Searching](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionsearch)", + "type": "string" + } + }, + "responses": { + "error": { + "description": "Error", + "schema": { + "$ref": "#/definitions/error" + } + } + } +} diff --git a/tools/tests/annotations-v4.xml b/tools/tests/annotations-v4.xml new file mode 100644 index 00000000..18431813 --- /dev/null +++ b/tools/tests/annotations-v4.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Quantity/@Measures.Unit + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/tests/annotations.openapi3.json b/tools/tests/annotations.openapi3.json index b76926be..e7bc74e9 100644 --- a/tools/tests/annotations.openapi3.json +++ b/tools/tests/annotations.openapi3.json @@ -1981,7 +1981,14 @@ "ReadOnlySingleton", "TwoReadOnlySet" ], - "parameters": [], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + } + ], "responses": { "200": { "description": "Retrieved entities", @@ -2860,7 +2867,7 @@ ], "format": "decimal", "x-sap-scale": 5, - "multipleOf": 0.00001, + "multipleOf": 1e-05, "minimum": 0, "exclusiveMinimum": true, "example": 1 @@ -3067,7 +3074,7 @@ ], "format": "decimal", "x-sap-scale": 5, - "multipleOf": 0.00001, + "multipleOf": 1e-05, "minimum": 0, "exclusiveMinimum": true, "example": 1 @@ -3134,9 +3141,7 @@ } }, "required": [ - "ID", - "PatternExt", - "AllowedValuesExt" + "ID" ], "title": "SinglePartKey (for create)" }, @@ -3259,7 +3264,7 @@ ], "format": "decimal", "x-sap-scale": 5, - "multipleOf": 0.00001, + "multipleOf": 1e-05, "minimum": 0, "exclusiveMinimum": true, "example": 1 @@ -3442,4 +3447,4 @@ } } } -} \ No newline at end of file +} diff --git a/tools/tests/annotations.xml b/tools/tests/annotations.xml index aea61059..b7ce997e 100644 --- a/tools/tests/annotations.xml +++ b/tools/tests/annotations.xml @@ -298,7 +298,7 @@ - One + AllMany/One diff --git a/tools/transform.cmd b/tools/transform.cmd index db4e108e..745b779b 100644 --- a/tools/transform.cmd +++ b/tools/transform.cmd @@ -43,10 +43,12 @@ exit /b ) if [%5]==[/swagger] ( - java.exe org.apache.xalan.xslt.Process -L -XSL %here%V4-CSDL-to-OpenAPI.xsl -PARAM scheme %2 -PARAM host %3 -PARAM basePath %4 -PARAM odata-version %ODATA_VERSION% -PARAM diagram YES -PARAM openapi-root "https://raw.githubusercontent.com/oasis-tcs/odata-openapi/master/examples/" -PARAM openapi-version 2.0 -IN %INPUT% -OUT %~dpn1.tmp2.json + java.exe org.apache.xalan.xslt.Process -L -XSL %here%resolve-paths.xsl -IN %INPUT% -OUT %here%%~n1.tmp2.xml + java.exe org.apache.xalan.xslt.Process -L -XSL %here%V4-CSDL-to-OpenAPI.xsl -PARAM scheme %2 -PARAM host %3 -PARAM basePath %4 -PARAM odata-version %ODATA_VERSION% -PARAM diagram YES -PARAM openapi-root "https://raw.githubusercontent.com/oasis-tcs/odata-openapi/master/examples/" -PARAM openapi-version 2.0 -IN %here%%~n1.tmp2.xml -OUT %~dpn1.tmp2.json python -m json.tool < %~dpn1.tmp2.json > %~dpn1.swagger.json if not errorlevel 1 ( + del %here%%~n1.tmp2.xml del %~dpn1.tmp2.json pushd . @@ -61,7 +63,8 @@ exit /b call :get-time t0 ) - java.exe org.apache.xalan.xslt.Process -L -XSL %here%V4-CSDL-to-OpenAPI.xsl -PARAM scheme %2 -PARAM host %3 -PARAM basePath %4 -PARAM odata-version %ODATA_VERSION% -PARAM diagram YES -PARAM openapi-root "https://raw.githubusercontent.com/oasis-tcs/odata-openapi/master/examples/" -PARAM openapi-version 3.0.0 -IN %INPUT% -OUT %~dpn1.tmp3.json + java.exe org.apache.xalan.xslt.Process -L -XSL %here%resolve-paths.xsl -IN %INPUT% -OUT %here%%~n1.tmp3.xml + java.exe org.apache.xalan.xslt.Process -L -XSL %here%V4-CSDL-to-OpenAPI.xsl -PARAM scheme %2 -PARAM host %3 -PARAM basePath %4 -PARAM odata-version %ODATA_VERSION% -PARAM diagram YES -PARAM openapi-root "https://raw.githubusercontent.com/oasis-tcs/odata-openapi/master/examples/" -PARAM openapi-version 3.0.0 -IN %here%%~n1.tmp3.xml -OUT %~dpn1.tmp3.json if [%5]==[/time] ( call :get-time t1 @@ -70,6 +73,7 @@ exit /b python -m json.tool < %~dpn1.tmp3.json > %~dpn1.openapi3.json if not errorlevel 1 ( + del %here%%~n1.tmp3.xml del %~dpn1.tmp3.json if [%ODATA_VERSION%]==[2.0] del %~dpn1.V4.xml if [%ODATA_VERSION%]==[3.0] del %~dpn1.V4.xml