{
    "openapi": "3.0.0",
    "info": {
        "title": "History data server",
        "version": "0.1.0"
    },
    "paths": {
        "/api/prices": {
            "get": {
                "summary": "Get Prices",
                "operationId": "get_prices_api_prices_get",
                "parameters": [
                    {
                        "name": "day",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "title": "Day"
                        },
                        "example": "2024-09-29"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/PriceRecord"
                                    },
                                    "title": "Prices",
                                    "x-body-name": "price_record"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Submit Prices",
                "operationId": "submit_prices_api_prices_post",
                "parameters": [
                    {
                        "name": "day",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "title": "Day"
                        },
                        "example": "2024-09-29"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/PriceRecord"
                                },
                                "title": "Prices",
                                "x-body-name": "price_record"
                            },
                            "example": [
                                {
                                    "estonian_time": "2024-09-29T12:00:00+03:00",
                                    "price": 6.02,
                                    "timestamp": 1727557200
                                }
                            ]
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/openapi.json": {
            "get": {
                "summary": "Get Openapi Schema",
                "operationId": "get_openapi_schema_openapi_json_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "HTTPValidationError": {
                "properties": {
                    "detail": {
                        "items": {
                            "$ref": "#/components/schemas/ValidationError"
                        },
                        "type": "array",
                        "title": "Detail"
                    }
                },
                "type": "object",
                "title": "HTTPValidationError"
            },
            "PriceRecord": {
                "properties": {
                    "timestamp": {
                        "type": "integer",
                        "title": "Timestamp"
                    },
                    "estonian_time": {
                        "type": "string",
                        "format": "date-time",
                        "title": "Estonian Time"
                    },
                    "price": {
                        "type": "number",
                        "title": "Price"
                    }
                },
                "type": "object",
                "required": [
                    "timestamp",
                    "estonian_time",
                    "price"
                ],
                "title": "PriceRecord"
            },
            "ValidationError": {
                "properties": {
                    "loc": {
                        "items": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "integer"
                                }
                            ]
                        },
                        "type": "array",
                        "title": "Location"
                    },
                    "msg": {
                        "type": "string",
                        "title": "Message"
                    },
                    "type": {
                        "type": "string",
                        "title": "Error Type"
                    }
                },
                "type": "object",
                "required": [
                    "loc",
                    "msg",
                    "type"
                ],
                "title": "ValidationError"
            }
        }
    }
}