Skip to content

Instantly share code, notes, and snippets.

@emersonsoares
Created June 7, 2017 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emersonsoares/0490a6fea4acebe03d973aabed7a5be9 to your computer and use it in GitHub Desktop.
Save emersonsoares/0490a6fea4acebe03d973aabed7a5be9 to your computer and use it in GitHub Desktop.
# Note: This spec is defined in multiple files.
# All comments and formating were lost during the bundle process.
# Existing files formatting may be not preserved on save.
swagger: '2.0'
info:
title: Cart API
description: Lorem Ipsum Dolor Sit Amet
version: 1.0.0
host: api.grupo-ltm.com
schemes:
- https
basePath: /v1
produces:
- application/json
- text/plain
securityDefinitions:
OAuth2:
type: oauth2
flow: accessCode
authorizationUrl: 'https://example.com/oauth/authorize'
tokenUrl: 'https://example.com/oauth/token'
scopes:
cart: Can manage participant cart
consumes:
- application/json
paths:
/carts/me:
get:
summary: Get my cart
description: Use este endpoint para obter o carrinho atual
security:
- OAuth2:
- cart
responses:
'200':
description: Ok
schema:
$ref: '#/definitions/cart'
definitions:
cart:
type: object
properties:
price:
type: number
format: decimal
description: 'Total cart price, in points'
items:
type: array
items:
$ref: '#/definitions/cartItem'
shippingAddress:
$ref: '#/definitions/shippingAddress'
cartItem:
type: object
properties:
skuId:
type: string
description: Product SKU Id
name:
type: string
description: Product name
category:
$ref: '#/definitions/category'
imageUrl:
type: string
description: Product image
price:
$ref: '#/definitions/price'
quantity:
type: integer
description: Item quantity in cart
vendorId:
type: string
description: Partner id
supplierType:
type: string
enum:
- PhysicalProducts
- ECommerce
- PhysicalVoucher
- VirtualVoucher
- Miles
- Others
- CellularRecharge
category:
type: object
properties:
id:
type: string
description: Category identifier
name:
type: string
description: Category display name
phone:
type: object
properties:
ddd:
type: string
number:
type: string
type:
type: string
enum:
- Home
- Commercial
- Cellular
price:
type: object
properties:
listingPrice:
type: number
format: decimal
description: Listing price
finalPrice:
type: number
format: decimal
description: Final price
receiver:
type: object
properties:
name:
type: string
documentNumber:
type: string
email:
type: string
birthDate:
type: string
format: datetime
personType:
type: string
enum:
- Individual
- Company
gender:
type: string
enum:
- Uninformed
- Male
- Female
phones:
type: array
items:
$ref: '#/definitions/phone'
shippingAddress:
type: object
properties:
name:
type: string
description: Address Name
number:
type: string
description: Address Number
complement:
type: string
district:
type: string
city:
type: string
state:
type: string
zipCode:
type: string
reference:
type: string
receiver:
$ref: '#/definitions/receiver'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment