一键导入
import-openapi
Generate a Tricentis Simulation YAML file from an OpenAPI/Swagger specification. Accepts a file path to a JSON or YAML OpenAPI spec, or a URL.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate a Tricentis Simulation YAML file from an OpenAPI/Swagger specification. Accepts a file path to a JSON or YAML OpenAPI spec, or a URL.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Scaffold a new Tricentis Simulation YAML file. Accepts a free-form description of the service to simulate (e.g. "a GET /users/{id} endpoint that returns user details, port 17080").
Explain what a Tricentis Simulation YAML file does in plain English. Accepts an optional file path; if omitted, explains all simulation files in the current directory.
| name | import-openapi |
| description | Generate a Tricentis Simulation YAML file from an OpenAPI/Swagger specification. Accepts a file path to a JSON or YAML OpenAPI spec, or a URL. |
| argument-hint | <path-to-openapi-spec> [output-file] |
| allowed-tools | Read, Write, Glob, WebFetch |
Generate a Tricentis Simulation YAML file from an OpenAPI specification.
Arguments: $ARGUMENTS
Parse the given OpenAPI spec and produce a complete, valid SimV1 simulation file. Follow these steps precisely.
Parse $ARGUMENTS to extract:
.json, .yaml, .yml): read it with the Read tool<spec-title-kebab-case>.yml in the current directoryGlob **/*.yml in the current directory to find existing simulation files. Note ports already in use to avoid collisions.
From the OpenAPI document extract:
info.title → derive the simulation name (PascalCase) and output filename (kebab-case)servers[0].url → base path (strip host; keep path prefix if any)paths → every {path} × {method} operation becomes one service:
operationId or derived name → service name (camelCase verb + subject)summary or description → service description{param}) → Path trigger + XB[param] buffer extractionQuery buffer extractionrequestBody schema → jsonPath buffer extractions for each propertyresponses["200"].content schema → shape the payload templateStructure:
schema: SimV1
name: <TitleFromSpec>
connections:
- name: <TitleFromSpec>Connection
port: <unused-port-in-17000-17999>
listen: true
services:
# one entry per OpenAPI operation
- name: <operationName>
description: <summary from spec>
steps:
- direction: In
name: <operationName>Request
from: <TitleFromSpec>Connection
trigger:
# exact path (no params):
- type: Uri
value: /base/path/here
# OR path with params:
- type: Path
value: /base/path/*
- property: Method
value: GET # uppercase
buffer:
# path params:
- type: Path
value: /base/path/{XB[paramName]}
# body fields:
- name: fieldName
jsonPath: fieldName
# query params:
- name: qParam
type: Query
key: qParam
- direction: Out
name: <operationName>Response
message:
statusCode: 200
headers:
- key: Content-Type
value: application/json
payload: |
<JSON skeleton matching the 200 response schema>
Payload generation rules:
200 response schema, emit a placeholder:
string → "example" or "{b[bufferName]}" if the value was buffered from the requestinteger / number → 0boolean → falsearray → []object → nested {}{id}, include "id": "{b[id]}" in the payload)4xx response is defined, add a second service for the error case (e.g. 404 when a resource is not found), using a verification block to trigger it based on a missing/invalid paramError service pattern:
- name: <operationName>NotFound
description: Returns 404 when resource does not exist
steps:
- direction: In
name: <operationName>NotFoundRequest
from: <TitleFromSpec>Connection
trigger:
- type: Path
value: /path/*
- property: Method
value: GET
buffer:
- type: Path
value: /path/{XB[id]}
- direction: Out
name: <operationName>NotFoundResponse
message:
statusCode: 404
headers:
- key: Content-Type
value: application/json
payload: |
{ "error": "Resource not found", "id": "{b[id]}" }
Ordering: list services in the same order as paths appear in the spec. Place more specific paths (fewer wildcards) before wildcard paths.
Write the generated simulation YAML to the output path.
Print a concise summary:
METHOD /path → serviceNamehttp://localhost:<port>)