Skip to content

Instantly share code, notes, and snippets.

@cokeSchlumpf
Created October 19, 2016 13:52
Show Gist options
  • Save cokeSchlumpf/fb49a261a564ddc9d0efe0cd9b70af7d to your computer and use it in GitHub Desktop.
Save cokeSchlumpf/fb49a261a564ddc9d0efe0cd9b70af7d to your computer and use it in GitHub Desktop.
swagger: '2.0'
info:
description: Discover REST APIs available within Liberty
version: 1.0.0
title: calc-sum-service
x-ibm-name: calc-sum-service
host: $(catalog.host)
tags:
- name: 'calculation-service for adding numbers! :)'
- name: about-service
definitions:
CalculationResult:
type: object
required:
- operation
- result
properties:
operation:
type: string
xml:
name: opertion
result:
type: integer
format: int32
CalculationRequest:
type: object
required:
- n1
properties:
n1:
type: integer
format: int32
n2:
type: integer
format: int32
paths:
/about:
get:
tags:
- about-service
summary: A sample REST endpoint
description: GET operation of a sample REST endpoint
operationId: about
parameters: []
responses:
'200':
description: successful operation
/calculation/add:
get:
tags:
- calculation-service for adding numbers
operationId: add
parameters:
- name: n1
in: query
required: false
type: integer
format: int32
- name: n2
in: query
required: false
type: integer
format: int32
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/CalculationResult'
headers: {}
post:
tags:
- calculation-service for adding numbers
operationId: add_0
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: false
schema:
$ref: '#/definitions/CalculationRequest'
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/CalculationResult'
headers: {}
/calculation/example:
get:
tags:
- calculation-service for adding numbers
operationId: example
parameters: []
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/CalculationRequest'
headers: {}
x-ibm-configuration:
phase: realized
testable: true
enforced: true
cors:
enabled: true
assembly:
execute:
- invoke:
description: Invoking back-end service
title: Invocation
target-url: $(backend_host)$(backend_basePath)$(api.operation.path)$(request.search)
properties:
backend_host:
value: 'https://wellnr-calc-sum-service.mybluemix.net'
description: ''
encoded: false
backend_basePath:
value: /wellnr-calc-sum-service/api
description: ''
encoded: false
catalogs: {}
gateway: micro-gateway
schemes:
- https
basePath: /api/calc-sum-service/v1
consumes:
- application/json
produces:
- application/json
securityDefinitions:
clientIdHeader:
type: apiKey
description: ''
in: header
name: X-IBM-Client-Id
clientSecretHeader:
type: apiKey
description: ''
in: header
name: X-IBM-Client-Secret
security:
- clientIdHeader: []
clientSecretHeader: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment