Skip to content

Commit 3b81ddb

Browse files
committed
transform.cmd
1 parent 51871a9 commit 3b81ddb

File tree

2 files changed

+11255
-3
lines changed

2 files changed

+11255
-3
lines changed

tools/tests/API_SalesOrder.openapi3.json

Lines changed: 11249 additions & 1 deletion
Large diffs are not rendered by default.

tools/transform.cmd

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ exit /b
4343
)
4444

4545
if [%5]==[/swagger] (
46-
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
46+
java.exe org.apache.xalan.xslt.Process -L -XSL %here%resolve-paths.xsl -IN %INPUT% -OUT %here%%~n1.tmp2.xml
47+
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
4748

4849
python -m json.tool < %~dpn1.tmp2.json > %~dpn1.swagger.json
4950
if not errorlevel 1 (
51+
del %here%%~n1.tmp2.xml
5052
del %~dpn1.tmp2.json
5153

5254
pushd .
@@ -61,7 +63,8 @@ exit /b
6163
call :get-time t0
6264
)
6365

64-
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
66+
java.exe org.apache.xalan.xslt.Process -L -XSL %here%resolve-paths.xsl -IN %INPUT% -OUT %here%%~n1.tmp3.xml
67+
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
6568

6669
if [%5]==[/time] (
6770
call :get-time t1
@@ -70,6 +73,7 @@ exit /b
7073

7174
python -m json.tool < %~dpn1.tmp3.json > %~dpn1.openapi3.json
7275
if not errorlevel 1 (
76+
del %here%%~n1.tmp3.xml
7377
del %~dpn1.tmp3.json
7478
if [%ODATA_VERSION%]==[2.0] del %~dpn1.V4.xml
7579
if [%ODATA_VERSION%]==[3.0] del %~dpn1.V4.xml

0 commit comments

Comments
 (0)