Skip to main content
17-Peridot
February 13, 2020
Solved

Swagger service for the Odata API

  • February 13, 2020
  • 2 replies
  • 4110 views

Hi all,

I know of the Swagger service at <server>/Windchill/netmarkets/jsp/restapi/ , and it works well to experiment with the REST API at <server>/Windchill/servlet/rest/structure/objects

 

Is there also an equivalent Swagger service for the Odata API at <server>/Windchill/servlet/odata/ ?

thanks

Rick

Best answer by mvonhasselbach

There are ways to describe the OData API with a Swagger definition. In fact this is even used in the WRS documentation browser, where the documentation on domain service level is rendered with the Swagger doc pages.  If you pay close attention you will even see that tehre is a URL in WIndchill that converts the OData to a Swagger/OpenAPI v2 service description.

 

windchill.jpg

 

 

 

This resource link (https://<server>/Windchill/netmarkets/html/wrs/odata-to-swagger.jsp?v=2&d=CADDocumentMgmt can also be used separately and the result will be the Swagger service description of the corresponding OData Domain and version in JSON format.
The generated OIpenAPIv2 service description has minor issues:

  1. it uses operationIds which are not unique. According to the spec operationIds are optional so you can fix it by removing them altogether.
  2. it doesn't include the name attribute for requestBody input params. According to the spec these are required but will be ignored. You can fix it by adding any name e.g. 'body' in the generated json.

I hope this answer is not too late - I thought it would be good to know....

2 replies

12-Amethyst
January 8, 2021

There are ways to describe the OData API with a Swagger definition. In fact this is even used in the WRS documentation browser, where the documentation on domain service level is rendered with the Swagger doc pages.  If you pay close attention you will even see that tehre is a URL in WIndchill that converts the OData to a Swagger/OpenAPI v2 service description.

 

windchill.jpg

 

 

 

This resource link (https://<server>/Windchill/netmarkets/html/wrs/odata-to-swagger.jsp?v=2&d=CADDocumentMgmt can also be used separately and the result will be the Swagger service description of the corresponding OData Domain and version in JSON format.
The generated OIpenAPIv2 service description has minor issues:

  1. it uses operationIds which are not unique. According to the spec operationIds are optional so you can fix it by removing them altogether.
  2. it doesn't include the name attribute for requestBody input params. According to the spec these are required but will be ignored. You can fix it by adding any name e.g. 'body' in the generated json.

I hope this answer is not too late - I thought it would be good to know....

7-Bedrock
July 21, 2021

We have 11.0 M030 CPS18 but navidating to the URL https://<server>/Windchill/netmarkets/html/wrs/doc.html

I get the results below.

SB_7831082_0-1626874585566.png

 

With Rest services Help I am able to get the Swagger documentation

https://<server>/Windchill/netmarkets/jsp/restapi/index.html#!/Objects/findObjects

SB_7831082_1-1626874839295.png

 

Any reason why the ODATA swagger does not exist/ open?

 

rleir17-PeridotAuthor
17-Peridot
August 12, 2021

I did not install CPS18 myself, but I did read the installation instructions and they seemed more complex than normal. And I do remember seeing the same {{domain.page}} display as you. Then I notified our admin and a short while later it was working correctly.