UNPKG

rapipdf

Version:

RapiPdf - Generate PDF from Open API spec

84 lines (83 loc) 2.12 kB
{ "swagger": "2.0", "info": { "title": "any-of Models", "description": "Spec containing model composition using any-of. Checkout the model definition under the RESPONSE section" }, "consumes": [ "application/json"], "produces": [ "application/json"], "paths": { "/api/employee": { "get": { "tags": [ "Employee Details"], "summary": "List of employees", "operationId": "empDetails", "responses": { "200": { "description": "Checkout the model tab to view object schemas defined using any-of", "schema": { "type": "array", "items": { "$ref": "#/definitions/employee" } } } } } } }, "definitions": { "employee": { "type": "object", "additionalProperties": false, "properties": { "Id": { "type": "string", "description": "Employee ID" }, "Employee": { "description": "Employee Details (Worker or Manager)", "anyOf": [ { "$ref": "#/definitions/name"}, { "$ref": "#/definitions/job"} ] } } }, "name": { "type": "object", "additionalProperties": false, "properties": { "firstName": { "type": "string", "description": "First name" }, "lastName": { "type": "string", "description": "Last Name" } } }, "job": { "type": "object", "additionalProperties": false, "properties": { "jobTitle": { "type": "string", "description": "Job title" }, "department": { "type": "string", "description": "Department name" }, "salary": { "type": "number", "description": "Salary per annum" } } } }, "tags": [ { "name": "Employee Details", "description": "Employee Details" } ] }