Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

patch swagger

// EXAMPLE TO PUT IN YOUR YAML 3.0.1 SWAGGER EDITOR

  /Cliente/{id_cliente}:
    patch:
      tags:
        - Cliente
      summary: Editar parâmetro do Cliente
      operationId: PAtchClienteById
      parameters:
        - name: id_cliente
          in: path
          description: ID do Cliente
          required: true
          style: simple
          explode: false
          schema:
            type: integer
            format: int64
      requestBody:
        description: Update customer with properties to be changed
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientePropriedade'
      responses:
        "200":
          description: Cliente Editado
          content:
            application/xml:
              schema:
                $ref: "#/components/schemas/Cliente"
            application/json:
              schema:
                $ref: "#/components/schemas/Cliente"
        "400":
          description: ID inválido
        "401":
          description: Não Autorizado
        "404":
          description: Cliente não encontrado
      security:
        - bearerAuth: []
      x-codegen-request-body-name: body
      x-swagger-router-controller: Cliente

components:
  schemas:
    ClientePropriedade:
      type: object
      properties:
        morada:
          type: string
          
    Cliente:
      required:
        - id_cliente
        - nome
        - nif
        - morada
        - pontos_atuais
      type: object
      properties:
        id_cliente:
          type: integer
          format: int64
        nome:
          type: string
        nif:
          type: integer
          format: int64
        morada:
          type: string
        pontos_atuais:
          type: integer
          format: int64
      example:
        id_cliente: 6
        nome: nome
        nif: 1
        morada: morada
        pontos_atuais: 5
      xml:
        name: Cliente
 
PREVIOUS NEXT
Tagged: #patch #swagger
ADD COMMENT
Topic
Name
7+1 =