Development
Konvertiert OpenAPI- oder Swagger-Spezifikationen in JSON/YAML in TypeScript-API-Typen, Anfrageparameter und Antwortmodelle mit konfigurierbarem Ausgabeformat und Namensstil
Rufen Sie dieses Werkzeug aus Ihrem Code in drei Sprachen auf.
curl -X POST 'https://api.elysiatools.com/de/api/tools/openapi-to-typescript-generator' \
-H 'Content-Type: application/json' \
-d '{"specInput":"openapi: 3.0.0\ninfo:\n title: User API\n version: 1.0.0\npaths:\n /users/{id}:\n get:\n operationId: getUser\n parameters:\n - in: path\n name: id\n required: true\n schema:\n type: string\n responses:\n \"200\":\n description: ok\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/User\"\ncomponents:\n schemas:\n User:\n type: object\n required: [id, name]\n properties:\n id:\n type: string\n name:\n type: string","sourceFormat":"yaml","outputFormat":"flat","namingStyle":"pascal","declarationStyle":"interface","namespaceName":"Api","includeOperationTypes":true,"includeDescriptions":true}'Senden Sie eine POST-Anfrage mit Ihren Eingaben als JSON. Dateiparameter erfordern einen vorherigen Upload.
POST https://api.elysiatools.com/de/api/tools/openapi-to-typescript-generator| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
| specInput | textarea | Ja | — |
| sourceFormat | select | Nein | — |
| outputFormat | select | Nein | — |
| namingStyle | select | Nein | — |
| declarationStyle | select | Nein | — |
| namespaceName | text | Nein | — |
| includeOperationTypes | checkbox | Nein | — |
| includeDescriptions | checkbox | Nein | — |
Textergebnis
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Fügen Sie dieses Werkzeug Ihrem Model-Context-Protocol-Server hinzu, damit KI-Agenten es auflisten und aufrufen können.
Fügen Sie diesen Block Ihrer MCP-Client-Konfiguration hinzu:
{
"mcpServers": {
"elysiatools-openapi-to-typescript-generator": {
"name": "openapi-to-typescript-generator",
"description": "Konvertiert OpenAPI- oder Swagger-Spezifikationen in JSON/YAML in TypeScript-API-Typen, Anfrageparameter und Antwortmodelle mit konfigurierbarem Ausgabeformat und Namensstil",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=openapi-to-typescript-generator",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Nach dem Verbinden mit dem SSE-Endpunkt listen Sie die bereitgestellten Werkzeuge auf:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Rufen Sie das Werkzeug über seine ID auf; Argumente werden aus seiner Parameterliste gebildet:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "openapi-to-typescript-generator",
"arguments": {
"specInput": "openapi: 3.0.0\ninfo:\n title: User API\n version: 1.0.0\npaths:\n /users/{id}:\n get:\n operationId: getUser\n parameters:\n - in: path\n name: id\n required: true\n schema:\n type: string\n responses:\n \"200\":\n description: ok\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/User\"\ncomponents:\n schemas:\n User:\n type: object\n required: [id, name]\n properties:\n id:\n type: string\n name:\n type: string",
"sourceFormat": "yaml",
"outputFormat": "flat",
"namingStyle": "pascal",
"declarationStyle": "interface",
"namespaceName": "Api",
"includeOperationTypes": true,
"includeDescriptions": true
}
}
}Fragen oder Probleme? Kontakt: [email protected]