Flex Gateway新着情報
Governance新着情報
Monitoring API Managerこれらのサンプルは、生成 AI 機能の使用を開始し、独自のユースケースに合わせてメッセージを作成する方法を理解するのに役立ちます。
| 生成サポートは現在、RAML 1.0 および OAS 3.0 仕様に制限されています。 |
あなたの会社は成長を続ける E コマースプラットフォームを管理しており、顧客の注文の処理を効率化する方法を必要としています。バックエンドシステムで注文を作成、取得、更新、削除し、すべての操作で一貫したデータモデルと堅牢なエラー処理を確保できる API 仕様を構築したいと考えています。
このタスクの仕様を生成するには、次のようなメッセージを入力します。Generate an API specification for an order management system for an e-commerce platform. The API should include endpoints to create, retrieve, update, and delete orders, along with detailed definitions for request and response payloads, versioning details, and error handling mechanisms. (E コマースプラットフォームの注文管理システムの API 仕様を生成します。API には、注文を作成、取得、更新、削除するためのエンドポイントに加えて、要求と応答のペイロード、バージョン設定の詳細、エラー処理メカニズムの詳細な定義が含まれている必要があります。)
このメッセージは、フォーカスされていたファイルと同じ仕様言語を使用して API 仕様を生成します。
openapi: 3.0.0
info:
title: Order Management API
version: 1.0.0
description: API for managing orders in an e-commerce platform.
servers:
- url: https://api.ecommerce.com/v1
paths:
/orders:
post: (1)
summary: Create a new order
operationId: createOrder
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
responses:
'201':
description: Order created successfully
'400':
description: Bad request
'401':
description: Unauthorized
'500':
description: Internal server error
security:
- bearerAuth: []
get: (2)
summary: Retrieve all orders
operationId: getOrders
responses:
'200':
description: A list of orders
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Order'
'401':
description: Unauthorized
'500':
description: Internal server error
security:
- bearerAuth: []
/orders/{orderId}: (3)
get:
summary: Retrieve a specific order
operationId: getOrder
parameters:
- name: orderId
in: path
required: true
schema:
type: string
responses:
'200':
description: Order details
'404':
description: Order not found
put:
summary: Update an existing order
operationId: updateOrder
parameters:
- name: orderId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
responses:
'200':
description: Order updated successfully
'404':
description: Order not found
delete:
summary: Delete an order
operationId: deleteOrder
parameters:
- name: orderId
in: path
required: true
schema:
type: string
responses:
'204':
description: Order deleted successfully
'404':
description: Order not found
components:
securitySchemes: (4)
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas: (5)
Order:
type: object
properties:
id:
type: string
customerId:
type: string
items:
type: array
items:
$ref: '#/components/schemas/OrderItem'
totalAmount:
type: number
format: float
status:
type: string
enum: [pending, processing, completed, cancelled]
OrderItem:
type: object
properties:
productId:
type: string
quantity:
type: integer
price:
type: number
format: float
| 1 | 新しい注文を作成する: POST /orders 操作は JSON ペイロードを受け入れ、成功またはエラーの応答を返します。 |
| 2 | すべての注文のリストを取得する: GET /orders 操作は、注文オブジェクトの配列を返します。 |
| 3 | 特定の注文の操作を処理する: パスパラメーター検証を使用する /orders/{orderId} の GET、PUT、DELETE メソッドが含まれます。 |
| 4 | ベアラートークン認証を使用する: すべてのエンドポイントを保護するために、bearerAuth スキームが適用されます。 |
| 5 | 再利用可能なデータモデルを定義する: Order および OrderItem スキーマは、要求ペイロードと応答ペイロードに一貫した構造を提供します。 |
あなたのビジネスは、複数のウェアハウスやストアフロントにわたる商品在庫を追跡および管理する必要があります。正確な在庫レベルを確保し、過剰販売を防ぐために、商品の作成、更新、削除、リストをサポートする API 仕様を生成する必要があります。仕様には、明確なデータモデル、入力規則ルール、適切なセキュリティメカニズムが含まれている必要があります。
このタスクの仕様を生成するには、次のようなメッセージを入力します。
Generate an API specification for an inventory management system. The API should expose endpoints to manage products and stock levels, support operations to add, update, delete, and list products, and include clear definitions for data models, input validation rules, and security considerations. (在庫管理システムの API 仕様を生成します。API は、商品と在庫レベルを管理し、商品の追加、更新、削除、リストの操作をサポートするためのエンドポイントを公開し、データモデル、入力検証ルール、セキュリティ上の考慮事項の明確な定義を含める必要があります。)
openapi: 3.0.0
info:
title: Inventory Management API
version: 1.0.0
description: API for managing products and stock levels.
servers:
- url: https://api.inventory.com/v1
paths:
/products:
post: (1)
summary: Add a new product
operationId: addProduct
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
responses:
'201':
description: Product added successfully
'400':
description: Invalid input
security:
- bearerAuth: []
get: (2)
summary: List all products
operationId: listProducts
responses:
'200':
description: A list of products
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Product'
'500':
description: Internal server error
security:
- bearerAuth: []
/products/{productId}: (3)
get:
summary: Get product details
operationId: getProduct
parameters:
- name: productId
in: path
required: true
schema:
type: string
responses:
'200':
description: Product data
'404':
description: Product not found
put:
summary: Update a product
operationId: updateProduct
parameters:
- name: productId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
responses:
'200':
description: Product updated
'400':
description: Invalid input
'404':
description: Product not found
delete:
summary: Delete a product
operationId: deleteProduct
parameters:
- name: productId
in: path
required: true
schema:
type: string
responses:
'204':
description: Product deleted
'404':
description: Product not found
components:
securitySchemes:(4)
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas: (5)
Product:
type: object
required: [id, name, quantity, price]
properties:
id:
type: string
name:
type: string
description:
type: string
quantity:
type: integer
minimum: 0
price:
type: number
format: float
| 1 | 新しい商品を作成する: POST /products 操作は、JSON ペイロードを使用して商品を定義します。 |
| 2 | すべての商品をリストする: GET /products 操作は、在庫商品の配列を返します。 |
| 3 | 個々の商品を管理する: ID を使用して特定の商品を取得、更新、または削除する操作が含まれます。 |
| 4 | ベアラー認証でエンドポイントを保護する: この API は bearerAuth を使用して、インベントリ操作を保護します。 |
| 5 | 検証済みの商品スキーマを含める: この商品スキーマは、必須項目と検証 (数量の最小値: 0 など) を適用します。 |
あなたのアプリケーションは、ユーザーデータを保護し、サービスへのアクセスを管理するために、安全で信頼性の高いユーザー認証が必要です。これをサポートするため、ユーザー登録、ログイン、トークン管理、パスワードのリセットを処理する API 仕様を生成する必要があります。仕様には、適切な入力規則、エラー応答、セキュリティのベストプラクティスが含まれている必要があります。
このタスクの仕様を生成するには、次のようなメッセージを入力します。
Generate an API specification for a user authentication and management service. The API should support endpoints for user registration, login, token management, and password resets, including thorough details on input validation, error responses, and necessary security protocols. (ユーザー認証および管理サービスの API 仕様を生成します。API は、入力規則、エラー応答、必要なセキュリティプロトコルに関する詳細な情報を含め、ユーザー登録、ログイン、トークン管理、パスワードリセットのエンドポイントをサポートする必要があります。)
このメッセージは、フォーカスされていたファイルと同じ仕様言語を使用して API 仕様を生成します。
openapi: 3.0.0
info:
title: User Auth API
version: 1.0.0
description: API for managing user authentication and credentials.
servers:
- url: https://api.example.com/v1
paths:
/register: (1)
post:
summary: Register a new user
operationId: registerUser
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RegisterRequest'
responses:
'201':
description: User created
'400':
description: Invalid input
/login: (2)
post:
summary: Authenticate a user
operationId: loginUser
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LoginRequest'
responses:
'200':
description: Login successful
'401':
description: Unauthorized
/token/refresh: (3)
post:
summary: Refresh an access token
operationId: refreshToken
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RefreshRequest'
responses:
'200':
description: Token refreshed
'401':
description: Invalid refresh token
/reset-password: (4)
post:
summary: Request password reset
operationId: resetPassword
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ResetRequest'
responses:
'200':
description: Password reset email sent
'404':
description: User not found
components:
securitySchemes: (5)
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas: (6)
RegisterRequest:
type: object
required: [email, password]
properties:
email:
type: string
format: email
password:
type: string
minLength: 8
LoginRequest:
type: object
required: [email, password]
properties:
email:
type: string
password:
type: string
RefreshRequest:
type: object
required: [refreshToken]
properties:
refreshToken:
type: string
ResetRequest:
type: object
required: [email]
properties:
email:
type: string
| 1 | 新規ユーザーを登録する: POST /register は入力を検証し、新しいユーザーアカウントを作成します。 |
| 2 | ユーザーをログインする: POST /login はログイン情報を確認し、成功時にトークンを返します。 |
| 3 | トークンを更新する: POST /token/refresh は、更新トークンを使用して新しいアクセストークンを発行します。 |
| 4 | パスワードのリセットを開始する: ユーザーが存在する場合、POST /reset-password はリセットメールを送信します。 |
| 5 | エンドポイントを保護する: 保護されたすべてのルートは JWT ベアラー認証を使用します。 |
| 6 | スキーマを定義する: UserRegistration および UserLogin スキーマには、minLength や format: email などの入力規則が含まれます。 |