{ "openapi": "3.0.1", "info": { "title": "Chapter09.Service", "version": "1.0" }, "paths": { "/CurrentTime": { "get": { "tags": [ "CurrentTime" ], "parameters": [ { "name": "timezoneId", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success" } } } }, "/Time/current": { "get": { "tags": [ "Time" ], "responses": { "200": { "description": "Success" } } } }, "/WeatherForecast": { "get": { "tags": [ "WeatherForecast" ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WeatherForecast" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WeatherForecast" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WeatherForecast" } } } } } } }, "post": { "tags": [ "WeatherForecast" ], "summary": "Saves a forecast at forecast date.", "requestBody": { "description": "Date which identifies a forecast. Using short date time string for identity.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WeatherForecast" } }, "text/json": { "schema": { "$ref": "#/components/schemas/WeatherForecast" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/WeatherForecast" } } } }, "responses": { "201": { "description": "Success" } } } }, "/WeatherForecast/error": { "get": { "tags": [ "WeatherForecast" ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WeatherForecast" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WeatherForecast" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WeatherForecast" } } } } } } } }, "/WeatherForecast/weekday/{day}": { "get": { "tags": [ "WeatherForecast" ], "parameters": [ { "name": "day", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "Success" } } } }, "/WeatherForecast/{date}": { "get": { "tags": [ "WeatherForecast" ], "summary": "Gets weather forecast at a specified date.", "parameters": [ { "name": "date", "in": "path", "description": "Date of a forecast.", "required": true, "schema": { "type": "string", "format": "date-time" } } ], "responses": { "404": { "description": "Not Found", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "200": { "description": "Success" } } } } }, "components": { "schemas": { "ProblemDetails": { "type": "object", "properties": { "type": { "type": "string", "nullable": true }, "title": { "type": "string", "nullable": true }, "status": { "type": "integer", "format": "int32", "nullable": true }, "detail": { "type": "string", "nullable": true }, "instance": { "type": "string", "nullable": true } }, "additionalProperties": { } }, "WeatherForecast": { "type": "object", "properties": { "date": { "type": "string", "format": "date-time" }, "temperatureC": { "type": "integer", "format": "int32" }, "temperatureF": { "type": "integer", "format": "int32", "readOnly": true }, "summary": { "type": "string", "nullable": true } }, "additionalProperties": false } } } }