#wso2 #swagger #content-type #apim #oas3
Вопрос:
Возможно ли иметь тип содержимого для внутреннего объекта тела запроса в OAS3 и отображать его в сгенерированной команде curl пользовательского интерфейса swagger при вызове вызова? Поддерживается ли эта функция в OAS3? Пример приведен ниже. Репортер-это внутренний объект.
paths: "/incidents/{incidentId}/type/file": post: summary: Add an image description: "Image" parameters: - name: incidentId in: path description: Incident ID required: true schema: type: string requestBody: content: multipart/form-data: schema: type: object required: - file properties: file: type: string description: File to upload format: binary type: type: string description: Type teamId: type: string description: Team ID incidentCreation: type: string description: "Test" professionalId: type: string description: Professional ID reporter: type: object properties: name: type: string actingAs: type: string contact: type: object properties: emailAddress: type: string phoneNumber: type: string language: type: object properties: user: type: string address: type: string encoding: file: contentType: application/octet-stream reporter: contentType: application/json required: true responses: "200": description: "" content: {} x-auth-type: "Application amp; Application User" x-throttling-tier: Unlimited x-codegen-request-body-name: Payload
Ниже приведена команда curl, созданная на портале магазина wso2am-2.2.0.
curl -k -X POST "https://192.168.8.101:8243/api/1.1.0/incidents/1232387912/type/file" -H "accept: */*" -H "Content-Type: multipart/form-data" -H "Authorization: Bearer 5eb36aea-1ed3-3a90-b578-356e89c79c99" -d {"type":"","teamId":"","incidentCreation":"","professionalId":"","reporter":"{ "name": "string", "actingAs": "string", "contact": { "emailAddress": "string", "phoneNumber": "string", "language": { "user": "string", "address": "string" } }}","file":{}}