开放式API代码生成PHP为operationID生成重复的函数名称

时间:2019-03-29 14:39:09

标签: php openapi openapi-generator

我的api的.yaml文件中包含以下代码段。我正在生成一个php客户端,并且得到重复的函数名称

public function addCustomer($customer = null, $image = null)
public function addCustomer($body)

这在php中是不允许的,并且会产生语法错误。如何为每种请求类型提供操作类型?

yaml操作ID addCustomer

  summary: Add a new customer to the store
  operationId: addCustomer
  requestBody:
    content:
      application/json:
        schema:
          $ref: '#/components/schemas/NewCustomerWithImageUrl'
      multipart/form-data:
        schema:
          $ref: '#/components/schemas/NewCustomerWithImage'
    description: Customer object that needs to be added to the store
    required: true

0 个答案:

没有答案