...
If you don't have an OpenAI/Swagger service definition to use, you can still get the AI Assistant's help creating a virtual asset. You can : simply provide it with text descriptions a description of how the service works, which can include endpoints, payloads, and so on, which and the AI Assistant will analyze your description then propose what responders the virtual asset it thinks would be most appropriate. This Depending on the complexity of what you need and the completeness of your description, this method can result in some gaps in the proposal which virtual asset that you might need to fill in, but it's a good way to get a jump on the process.
...
- endpoints
- responder correlations
- response payloads (literal)
- status codes
- parameterizations
The AI Assistant will propose a virtual asset and ask for changes before creating it. You can continue the conversation with it, refining the virtual asset until it is satisfactory. If it is struggling to the proposed virtual service before creating itunderstand aspects of your request, try giving it examples.
For example, you might ask the AI Assistant:
No Format |
---|
Create a virtual service to manage hotel room bookings. It should include CRUD operations for endpoints /bookings and /rooms. |
The AI Assistant can use this relatively simple prompt to create a virtual asset, but it might not be exactly what you want. A more detailed prompt, like the following, is more likely to get you exactly what you want:
No Format |
---|
Create a virtual service to manage hotel room bookings. Basepath: /hotel/api/v1 Endpoints: /bookings /bookings/{id} /rooms /rooms?guestName={name}&date={date} /rooms/{id} /rooms/{id}/availability /rooms/{id}/hold /guests /guests/{id} Details: 200 for success, 404 for not found, and 409 for conflicts (for example, double booking). Error responses for all endpoints should include a clear error message. Example request for POST - /bookings: { "roomId": 201, "roomNumber": "101A", "roomType": "Deluxe", "guestId": 301, "guestName": "John Doe", "checkIn": "2024-07-01", "checkOut": "2024-07-05", "price": 520, "specialRequests": "Late check-in" } Response returns "id" field and the same as request payload. |