Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TCApi2Postman

What is this?

TCApi2Postman was originally conceived as a utility that turns auto-generated Teamcenter REST API documentation into ready-to-use Postman collections. Later the decision was made to add full support for standalone OpenAPI 3.1.0 module documents as well without renaming the tool or creating a separate application. As a result, the same utility now produces either a complete Postman collection or OpenAPI 3.1.0 documents, each containing the request and response formats, examples, and documentation for every method.

--

Features

  • Provides a keyboard-driven terminal interface by default while preserving the existing argument-based CLI workflow.
  • Converts Teamcenter Active Workspace structure.js documentation into a Postman v2.1 collection or OpenAPI 3.1 module documents.
  • Generates request envelopes, response examples, and Markdown documentation for discovered API methods.
  • Writes standalone OpenAPI JSON or YAML files per <Library>-<Service> module with reusable schemas for structures, arrays, maps, enums, aliases, and recursive types.
  • Supports custom request headers and server defaults through --config, plus optional internal APIs through --include-internal.
  • Reports source and generated template, library, module, method, and file counts after conversion.

Who is it for?

Developers, QA engineers, Presales, etc. working with Teamcenter REST APIs

Instructions

Prerequisites

  • Java 21 or later (e.g., Azul Zulu, OpenJDK, or Oracle JDK)

    • Verify installation: java -version
    • Set JAVA_HOME environment variable to your JDK installation directory
  • Maven 3.6 or later (required to build from source)

Get Your Input Data

You'll need the structure.js file from your Teamcenter setup (AWC layer). Generate or regenerate it using:

  • cd ...\aws2\stage
  • initenv
  • npm run genSoaApi
  • cd ...\aws2\stage\out\soa\api

Note: You must regenerate structure.js after updating Teamcenter Core or AWC to ensure the API documentation is up-to-date with the latest changes.

Note: To include unpublished (Internal) API, before building structure.js, you MUST modify aws2\stage\initenv.cmd by adding a new line with the environment variable SOAGENAPI_INCLUDE_UNPUBLISHED set to true:

SET SOAGENAPI_INCLUDE_UNPUBLISHED=true

Run TCApi2Postman

Start the default terminal interface without arguments:

java -jar TCApi2Postman-#.#.#.jar

Use Tab and Shift+Tab to move between fields and controls, Left/Right or Space to change options, Enter to activate an action, PgUp/PgDn to scroll results, and Esc or Ctrl+C to quit. Input and Config paths remain editable, and each has a Browse action that opens an in-terminal file picker. The Input picker accepts .js files and the Config picker accepts .config files; manually entered paths remain unrestricted. The Output hint changes with the selected format without rewriting an entered path.

Inside a file picker, use Up/Down or j/k to navigate, Enter to select a file or open a directory, Right to open a directory, and Left, h, or Backspace to move to the parent directory. Esc returns to the form without changing the path, while Ctrl+C quits the application. The form remains open after generation so you can review the output or run another conversion. Quitting while generation is running is immediate and may leave partially written output.

The TUI requires an interactive terminal. In redirected, piped, or other non-interactive environments, use the CLI by supplying its existing arguments:

java -jar TCApi2Postman-#.#.#.jar <structure.js> <output-file-or-directory> [--format <postman|openapi-json|openapi-yaml>] [--include-internal] [--config <TCApi2Postman.config>]

Every nonempty argument list uses CLI mode. Postman remains the default output format when --format is omitted:

java -jar TCApi2Postman-#.#.#.jar C:\Siemens\Teamcenter\13\aws2\stage\out\soa\api\structure.js D:\Temp\TcApi_collection.json --config TCApi2Postman.config

Generate OpenAPI 3.1.0 as JSON:

java -jar TCApi2Postman-#.#.#.jar C:\Siemens\Teamcenter\13\aws2\stage\out\soa\api\structure.js D:\Temp\openapi-out-folder --format openapi-json --config TCApi2Postman.config

For OpenAPI, the second argument is an output directory. It is created, including missing parent directories, when necessary. The command above writes standalone files such as D:\Temp\openapi-out-folder\Core-Session.json and D:\Temp\openapi-out-folder\Core-DataManagement.json.

Generate OpenAPI 3.1.0 as YAML:

java -jar TCApi2Postman-#.#.#.jar C:\Siemens\Teamcenter\13\aws2\stage\out\soa\api\structure.js D:\Temp\openapi-out-folder --format openapi-yaml --config TCApi2Postman.config

Options:

  • --format <value>: Select postman (default), openapi-json, or openapi-yaml. Values are case-insensitive. Postman requires a .json output file; both OpenAPI modes require an output directory.
  • --include-internal: Include internal APIs in the output (optional, for the brave).
  • --config <file>: Point to a custom config file for request-header and Teamcenter server defaults.

On JDK 24 or later, JLine may print a restricted native-access warning when the TUI starts. If needed, suppress it with:

java --enable-native-access=ALL-UNNAMED -jar TCApi2Postman-#.#.#.jar

Each OpenAPI file contains one <Library>-<Service> module, all of its API versions and methods, and only the reusable schemas reachable from that module. Internal modules use names such as Internal-Core-Session.yaml. Existing module files with the same names are overwritten; unrelated files are not removed.

After a successful conversion, the command prints statistics for all source APIs and for the generated output, including external/internal method counts and methods excluded by the current flags.

Load the generated Postman JSON into Postman, or use the OpenAPI JSON/YAML module files with OpenAPI-compatible documentation, testing, and client-generation tools.

image image image image

Build TCApi2Postman from Source

If you're building from source, follow these steps:

  1. Clone or download this repository
  2. Navigate to the project directory
  3. Run the build:
    mvn clean package
  4. The compiled jar will be in the target/ directory (named TCApi2Postman-#.#.#.jar)

About

TCApi2Postman is application that converts auto-generated REST API documentation from Teamcenter into a fully-loaded Postman collection.

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages