167 lines
		
	
	
		
			4.1 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			167 lines
		
	
	
		
			4.1 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| openapi: 3.0.0
 | |
| 
 | |
| info:
 | |
|   version: 0.0.1
 | |
|   title: Mocked Service
 | |
|   description: Service for creating your own mocked endpoints
 | |
| 
 | |
| tags:
 | |
|   - name: "MockedMessage"
 | |
|   - name: "MessageHistory"
 | |
| 
 | |
| paths:
 | |
|   /mock/json/{uuid}:
 | |
|     get:
 | |
|       tags:
 | |
|         - "MockedMessage"
 | |
|       description: Generates new uuid and default message
 | |
|       parameters:
 | |
|         - in: path
 | |
|           name: uuid
 | |
|           required: true
 | |
|           description: If not given, server will create and return new one
 | |
|           schema:
 | |
|             type: string
 | |
|             example: '9bfddcc1-ef89-4c53-84e8-c88f13ecc7ec'
 | |
|       responses:
 | |
|         '200':
 | |
|           description: Message list sent
 | |
|           content:
 | |
|             application/json:
 | |
|               schema:
 | |
|                 $ref: '#/components/schemas/MockedMessage'
 | |
| 
 | |
|   /mock/json:
 | |
|     get:
 | |
|       tags:
 | |
|         - "MockedMessage"
 | |
|       description: Generates new uuid and default message
 | |
|       responses:
 | |
|         '200':
 | |
|           description: Message list sent
 | |
|           content:
 | |
|             application/json:
 | |
|               schema:
 | |
|                 $ref: '#/components/schemas/MockedMessage'
 | |
| 
 | |
|     post:
 | |
|       tags:
 | |
|         - "MockedMessage"
 | |
|       description: creates new message in the list
 | |
|       responses:
 | |
|         '200':
 | |
|           description: message has been created
 | |
| 
 | |
| 
 | |
|     put:
 | |
|       tags:
 | |
|         - "MockedMessage"
 | |
|       description: Adds new item or modifies existing
 | |
|       requestBody:
 | |
|         required: true
 | |
|         description: json format describing MockedMessage object
 | |
|         content:
 | |
|           application/json:
 | |
|             schema:
 | |
|               $ref: '#/components/schemas/MockedMessage'
 | |
|       responses:
 | |
|         '200':
 | |
|           description: message has been updated
 | |
| 
 | |
|   /mock/json/{uuid}/{id}:
 | |
|     delete:
 | |
|       tags:
 | |
|         - "MockedMessage"
 | |
|       description: Deletes message of given id assigned to given uuid
 | |
|       parameters:
 | |
|         - in: path
 | |
|           name: uuid
 | |
|           required: true
 | |
|           schema:
 | |
|             type: string
 | |
|             example: '9bfddcc1-ef89-4c53-84e8-c88f13ecc7ec'
 | |
|         - in: path
 | |
|           name: id
 | |
|           required: true
 | |
|           schema:
 | |
|             type: integer
 | |
|             example: 1
 | |
|       responses:
 | |
|         '200':
 | |
|           description: message has been deleted
 | |
| 
 | |
|   /api/event:
 | |
|     post:
 | |
|       tags:
 | |
|         - "MessageHistory"
 | |
|       description: returns history of responses for given uuid
 | |
|       requestBody:
 | |
|         required: true
 | |
|         description: json format describing Event query
 | |
|         content:
 | |
|           application/json:
 | |
|             schema:
 | |
|               $ref: '#/components/schemas/EventRequest'
 | |
|       responses:
 | |
|         '200':
 | |
|           description: history of given uuid
 | |
|           content:
 | |
|             application/json:
 | |
|               schema:
 | |
|                 $ref: '#/components/schemas/EventEntry'
 | |
| 
 | |
| 
 | |
| 
 | |
| components:
 | |
|   schemas:
 | |
| 
 | |
|     MockedMessage:
 | |
|       description: Model containing data about created response
 | |
|       properties:
 | |
|         mockedResponseId:
 | |
|           type: integer
 | |
|           example: 1
 | |
|         clientUUID:
 | |
|           type: string
 | |
|           example: '9bfddcc1-ef89-4c53-84e8-c88f13ecc7ec'
 | |
|         mediaType:
 | |
|           type: string
 | |
|           example: 'application/xml'
 | |
|         messageBody:
 | |
|           type: string
 | |
|           example: '<root><element>Hello World</element></root>'
 | |
|         httpStatus:
 | |
|           type: integer
 | |
|           example: 200
 | |
|         httpHeaders:
 | |
|           type: object
 | |
|           additionalProperties:
 | |
|             type: string
 | |
| 
 | |
|     EventRequest:
 | |
|       description: Model containing data about Event query
 | |
|       properties:
 | |
|         clientUUID:
 | |
|           type: string
 | |
|           example: '9bfddcc1-ef89-4c53-84e8-c88f13ecc7ec'
 | |
|         localDateTimeFrom:
 | |
|           type: string
 | |
|           example: '2021-01-01T01:01:01'
 | |
|         localDateTimeTo:
 | |
|           type: string
 | |
|           example: '2021-01-01T23:59:59'
 | |
|         mockedResponseId:
 | |
|           type: integer
 | |
|           example: 1
 | |
| 
 | |
|     EventEntry:
 | |
|       description: Model containing data about Event entry
 | |
|       properties:
 | |
|         dateTimeStamp:
 | |
|           type: string
 | |
|           example: '2021-01-01T01:01:01'
 | |
|         interfaceName:
 | |
|           type: string
 | |
|           example: 'MockedMessage - request'
 | |
| 
 |