go-microservices-tuto/swagger.yaml

81 lines
1.7 KiB
YAML

basePath: /
consumes:
- application/json
definitions:
Product:
description: Product defines the structure of a product
properties:
description:
type: string
x-go-name: Description
id:
format: int64
type: integer
x-go-name: ID
name:
type: string
x-go-name: Name
price:
format: float
type: number
x-go-name: Price
sku:
type: string
x-go-name: SKU
type: object
x-go-package: github.com/rjNemo/go-micro/products/models
info:
description: Documentation for Product API
title: Product API
version: 1.0.0
paths:
/products:
get:
description: Returns a list of products
operationId: listProducts
responses:
"200":
$ref: '#/responses/productsResponse'
tags:
- products
post:
description: Creates a product
operationId: product
responses:
"201":
$ref: '#/responses/productResponse'
tags:
- products
/products/{id}:
delete:
description: Deletes a product
operationId: product
responses:
"200":
$ref: '#/responses/productResponse'
tags:
- products
put:
description: Updates a product
operationId: product
responses:
"204":
$ref: '#/responses/productResponse'
tags:
- products
produces:
- application/json
responses:
productResponse:
description: product in the response. For go-swagger
schema:
$ref: '#/definitions/Product'
productsResponse:
description: list of products in the response. For go-swagger
schema:
items:
$ref: '#/definitions/Product'
type: array
schemes:
- http
swagger: "2.0"