{ "x-generator": "NSwag v14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))", "openapi": "3.0.0", "info": { "title": "Api", "version": "1.0.0" }, "paths": { "/v1/Schools/{schoolName}/principal": { "get": { "tags": [ "Schools" ], "summary": "Retrieve Principal by school name", "operationId": "Schools_GetPrincipalBySchool", "parameters": [ { "name": "schoolName", "in": "path", "required": true, "description": "The school name.", "schema": { "type": "string" }, "x-position": 1 } ], "responses": { "200": { "description": "A Person object representing the Principal.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Principal" } } } }, "404": { "description": "School not found." }, "400": { "description": "School cannot be null or empty." } } } }, "/v1/Schools/principals": { "post": { "tags": [ "Schools" ], "summary": "Retrieve a collection of principals by a collection of school names", "operationId": "Schools_GetPrincipalsBySchools", "requestBody": { "x-name": "request", "description": "The request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetPrincipalsBySchoolsQuery" } } }, "required": true, "x-position": 1 }, "responses": { "200": { "description": "A collection of Principal objects.", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Principal" } } } } }, "400": { "description": "School names cannot be null or empty." } } } }, "/v1/Schools": { "post": { "tags": [ "Schools" ], "summary": "Creates a new School along with the Principal Details", "operationId": "Schools_CreateSchool", "requestBody": { "x-name": "request", "description": "The request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSchoolCommand" } } }, "required": true, "x-position": 1 }, "responses": { "201": { "description": "School created successfully.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SchoolId" } } } }, "400": { "description": "Invalid request data." } } } }, "/v1/Schools/createReport": { "post": { "tags": [ "Schools" ], "summary": "An example endpoint to trigger a background task", "operationId": "Schools_CreateReport", "requestBody": { "x-name": "request", "description": "The request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportCommand" } } }, "required": true, "x-position": 1 }, "responses": { "200": { "description": "Task queued successfully.", "content": { "application/json": { "schema": { "type": "boolean" } } } }, "400": { "description": "Invalid request data." } } } } }, "components": { "schemas": { "Principal": { "allOf": [ { "$ref": "#/components/schemas/Person" }, { "type": "object", "additionalProperties": false, "properties": { "schoolName": { "type": "string" } } } ] }, "Person": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "integer", "format": "int32" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "email": { "type": "string" }, "displayName": { "type": "string" }, "displayNameWithTitle": { "type": "string" }, "phone": { "type": "string", "nullable": true }, "roles": { "type": "array", "items": { "type": "string" } }, "updatedAt": { "type": "string", "format": "date-time", "nullable": true } } }, "GetPrincipalsBySchoolsQuery": { "type": "object", "additionalProperties": false, "properties": { "schoolNames": { "type": "array", "items": { "type": "string" } } } }, "SchoolId": { "type": "object", "additionalProperties": false, "properties": { "value": { "type": "integer", "format": "int32" } } }, "CreateSchoolCommand": { "type": "object", "additionalProperties": false, "properties": { "schoolName": { "type": "string" }, "lastRefresh": { "type": "string", "format": "date-time" }, "endDate": { "type": "string", "format": "date", "nullable": true }, "nameDetails": { "$ref": "#/components/schemas/NameDetailsModel" }, "principalDetails": { "$ref": "#/components/schemas/PrincipalDetailsModel" } } }, "NameDetailsModel": { "type": "object", "additionalProperties": false, "properties": { "firstName": { "type": "string", "nullable": true }, "lastName": { "type": "string", "nullable": true }, "middleName": { "type": "string", "nullable": true } } }, "PrincipalDetailsModel": { "type": "object", "additionalProperties": false, "properties": { "email": { "type": "string" }, "phone": { "type": "string" }, "typeId": { "type": "integer", "format": "int32" } } }, "CreateReportCommand": { "type": "object", "additionalProperties": false } } } }