swagger编辑器UI发送OPTIONS请求方法而不是PUT和DELETE

时间:2018-01-03 11:37:28

标签: yaml swagger-editor

http://editor.swagger.io发送OPTIONS请求方法而不是PUT和DELETE但是对于POST和GET它完美地工作

即使我安装了Chrome扩展程序,也可以将Access-Control-Allow-Origin添加到外发请求中。并在c#代码中添加,如下所示

[EnableCors(起源:" ",标题:" ",方法:" *",exposedHeaders:& #34; X-DOCNAME,X-的docID&#34)]

   put:
  tags:
  - sources
  summary: Updated sources Groups
  description: This Will Create new Group under sources
  operationId: PUT
  consumes:
    - application/x-www-form-urlencoded
  produces:
  - application/json
  parameters:
  - name: sourceId
    in: path
    description: name that need to be updated
    required: true
    type: string

  - name: text
    in: formData
    description: Updated name of the text
    required: true
    type: string
  responses:
    200:
      description: "Ok : Successful requests"
    201:
      description: "Created : Successful creation"
    400:
      description: "Bad Request : The path info doesn't have the right format"
    403:
      description: "Forbidden : The invoker is not authorized to invoke the operation"
    404:
      description: "Not Found : The object referenced by the path does not exist" 
    500:
      description: "Internal Server Error : The execution of the service failed in some way" 

0 个答案:

没有答案
相关问题