{
    "openapi": "3.1.0",
    "info": {
        "title": "Tensoit API v2",
        "version": "2.0.2"
    },
    "servers": [
        {
            "url": "https://api.tensoit.pl",
            "description": "Production"
        }
    ],
    "tags": [
        {
            "name": "City"
        },
        {
            "name": "Street"
        },
        {
            "name": "Number"
        },
        {
            "name": "Postal"
        },
        {
            "name": "Check"
        },
        {
            "name": "Widget Autocomplete"
        },
        {
            "name": "Widget Session"
        }
    ],
    "security": [
        {
            "http": []
        }
    ],
    "paths": {
        "/v2/city/{city}": {
            "get": {
                "operationId": "cityV2.getCity",
                "tags": [
                    "City"
                ],
                "parameters": [
                    {
                        "name": "city",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v2/city": {
            "post": {
                "operationId": "cityV2.postCity",
                "tags": [
                    "City"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "city": {
                                        "type": "string",
                                        "default": ""
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v2/street/{city}/{street}": {
            "get": {
                "operationId": "streetV2.getStreet",
                "tags": [
                    "Street"
                ],
                "parameters": [
                    {
                        "name": "city",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "street",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "streetPrefix",
                        "in": "query",
                        "description": "Optional display mode. `dotted` turns a leading ulica/ul. into `ul.` and aleja into `al.`. `compact` drops a leading ulica/ul. and still turns aleja into `al.`. `natural` drops a leading ulica/ul. and capitalizes only the first letter of a leading aleja, leaving the rest of that name as stored. Omit it, or send an empty string, to keep the stored name. When set, the response adds `labels` in the same order as `suggestions`. Send `suggestions` to number and postal.",
                        "schema": {
                            "$ref": "#/components/schemas/StreetPrefixMode"
                        },
                        "example": "dotted"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v2/street": {
            "post": {
                "operationId": "streetV2.postStreet",
                "tags": [
                    "Street"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "city": {
                                        "type": "string",
                                        "default": ""
                                    },
                                    "street": {
                                        "type": "string",
                                        "default": ""
                                    },
                                    "streetPrefix": {
                                        "description": "Optional display mode. `dotted` turns a leading ulica/ul. into `ul.` and aleja into `al.`. `compact` drops a leading ulica/ul. and still turns aleja into `al.`. `natural` drops a leading ulica/ul. and capitalizes only the first letter of a leading aleja, leaving the rest of that name as stored. Omit it, or send an empty string, to keep the stored name. When set, the response adds `labels` in the same order as `suggestions`. Send `suggestions` to number and postal.",
                                        "examples": [
                                            "dotted"
                                        ],
                                        "$ref": "#/components/schemas/StreetPrefixMode"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v2/number/{city}/{street}/{number}": {
            "get": {
                "operationId": "numberV2.getNumber",
                "tags": [
                    "Number"
                ],
                "parameters": [
                    {
                        "name": "city",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "street",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "description": "**Optional**",
                        "schema": {
                            "type": "string",
                            "default": ""
                        },
                        "x-optional": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v2/number": {
            "post": {
                "operationId": "numberV2.postNumber",
                "tags": [
                    "Number"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "city": {
                                        "type": "string",
                                        "default": ""
                                    },
                                    "street": {
                                        "type": "string",
                                        "default": ""
                                    },
                                    "number": {
                                        "type": "string",
                                        "default": ""
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v2/postal/{city}/{street}/{number}": {
            "get": {
                "operationId": "postalV2.getPostal",
                "tags": [
                    "Postal"
                ],
                "parameters": [
                    {
                        "name": "city",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "street",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "description": "**Optional**",
                        "schema": {
                            "type": "string",
                            "default": ""
                        },
                        "x-optional": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v2/postal": {
            "post": {
                "operationId": "postalV2.postPostal",
                "tags": [
                    "Postal"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "city": {
                                        "type": "string",
                                        "default": ""
                                    },
                                    "street": {
                                        "type": "string",
                                        "default": ""
                                    },
                                    "number": {
                                        "type": "string",
                                        "default": ""
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v2/check/{city}/{street}/{number}/{postal}": {
            "get": {
                "operationId": "checkV2.getCheck",
                "tags": [
                    "Check"
                ],
                "parameters": [
                    {
                        "name": "city",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "street",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "postal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ApiV2CheckResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2CheckResource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v2/check": {
            "post": {
                "operationId": "checkV2.postCheck",
                "tags": [
                    "Check"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "city": {
                                        "type": "string",
                                        "default": ""
                                    },
                                    "street": {
                                        "type": "string",
                                        "default": ""
                                    },
                                    "number": {
                                        "type": "string",
                                        "default": ""
                                    },
                                    "postal": {
                                        "type": "string",
                                        "default": ""
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ApiV2CheckResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2CheckResource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/widget/v2/city/{city}": {
            "get": {
                "operationId": "widgetAutocomplete.city",
                "tags": [
                    "Widget Autocomplete"
                ],
                "parameters": [
                    {
                        "name": "city",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/widget/v2/street/{city}/{street}": {
            "get": {
                "operationId": "widgetAutocomplete.street",
                "tags": [
                    "Widget Autocomplete"
                ],
                "parameters": [
                    {
                        "name": "city",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "street",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "streetPrefix",
                        "in": "query",
                        "description": "Optional display mode. `dotted` turns a leading ulica/ul. into `ul.` and aleja into `al.`. `compact` drops a leading ulica/ul. and still turns aleja into `al.`. `natural` drops a leading ulica/ul. and capitalizes only the first letter of a leading aleja, leaving the rest of that name as stored. Omit it, or send an empty string, to keep the stored name. When set, the response adds `labels` in the same order as `suggestions`. Send `suggestions` to number and postal.",
                        "schema": {
                            "$ref": "#/components/schemas/StreetPrefixMode"
                        },
                        "example": "dotted"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/widget/v2/number/{city}/{street}/{number}": {
            "get": {
                "operationId": "widgetAutocomplete.number",
                "tags": [
                    "Widget Autocomplete"
                ],
                "parameters": [
                    {
                        "name": "city",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "street",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "description": "**Optional**",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "default": null
                        },
                        "x-optional": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/widget/v2/number": {
            "post": {
                "operationId": "widgetAutocomplete.postNumber",
                "tags": [
                    "Widget Autocomplete"
                ],
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/widget/v2/postal/{city}/{street}/{number}": {
            "get": {
                "operationId": "widgetAutocomplete.postal",
                "tags": [
                    "Widget Autocomplete"
                ],
                "parameters": [
                    {
                        "name": "city",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "street",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "description": "**Optional**",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "default": null
                        },
                        "x-optional": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/widget/v2/postal": {
            "post": {
                "operationId": "widgetAutocomplete.postPostal",
                "tags": [
                    "Widget Autocomplete"
                ],
                "responses": {
                    "200": {
                        "description": "`ApiV2Resource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiV2Resource"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/widget/v2/session": {
            "post": {
                "operationId": "widgetSession.store",
                "tags": [
                    "Widget Session"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "session_token": {
                                            "type": "string"
                                        },
                                        "expires_in": {
                                            "type": [
                                                "object",
                                                "null"
                                            ]
                                        },
                                        "token_type": {
                                            "type": "string",
                                            "const": "Bearer"
                                        }
                                    },
                                    "required": [
                                        "session_token",
                                        "expires_in",
                                        "token_type"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v2/health/ping": {
            "get": {
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "ok"
                                        },
                                        "service": {
                                            "type": "string",
                                            "const": "api-v2"
                                        },
                                        "timestamp": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "service",
                                        "timestamp"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v2/health/sql-city/{prefix}": {
            "get": {
                "parameters": [
                    {
                        "name": "prefix",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "ok"
                                        },
                                        "type": {
                                            "type": "string",
                                            "const": "sql-city"
                                        },
                                        "prefix": {
                                            "type": "string"
                                        },
                                        "duration_ms": {
                                            "type": "number"
                                        },
                                        "rows": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "type",
                                        "prefix",
                                        "duration_ms",
                                        "rows"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/{fallbackPlaceholder}": {
            "get": {
                "operationId": "fallback",
                "parameters": [
                    {
                        "name": "fallbackPlaceholder",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "const": "Not Found!"
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "http": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "id|token"
            }
        },
        "schemas": {
            "ApiV2CheckResource": {
                "type": "object",
                "properties": {
                    "code": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "integer",
                                "enum": [
                                    200
                                ]
                            }
                        ]
                    },
                    "status": {
                        "description": "HTTP status code, default 200 for successful responses",
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "string",
                                "enum": [
                                    "success"
                                ]
                            }
                        ]
                    },
                    "type": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "path": {
                        "type": "string",
                        "description": "Type of address response (city, street, postal, full_address)"
                    },
                    "message": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "API path that was queried"
                    },
                    "exists": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "boolean"
                            }
                        ]
                    }
                },
                "required": [
                    "code",
                    "status",
                    "type",
                    "path",
                    "message",
                    "exists"
                ],
                "title": "ApiV2CheckResource"
            },
            "ApiV2Resource": {
                "type": "object",
                "properties": {
                    "code": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "integer",
                                "enum": [
                                    200
                                ]
                            }
                        ]
                    },
                    "status": {
                        "description": "HTTP status code, default 200 for successful responses",
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "string",
                                "enum": [
                                    "success"
                                ]
                            }
                        ]
                    },
                    "type": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "path": {
                        "type": "string",
                        "description": "Type of address response (city, street, postal, full_address)"
                    },
                    "message": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "API path that was queried"
                    },
                    "suggestions": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "minItems": 0,
                                "maxItems": 0,
                                "additionalItems": false
                            }
                        ]
                    },
                    "labels": {
                        "type": "array",
                        "items": {}
                    }
                },
                "required": [
                    "code",
                    "status",
                    "type",
                    "path",
                    "message",
                    "suggestions"
                ],
                "title": "ApiV2Resource"
            },
            "StreetPrefixMode": {
                "type": "string",
                "enum": [
                    "dotted",
                    "compact",
                    "natural"
                ],
                "title": "StreetPrefixMode"
            }
        }
    }
}