{ "openapi": "3.0.2", "info": { "title": "Quick wallet app", "version": "0.1.0" }, "paths": { "/auth/register": { "post": { "tags": [ "auth" ], "summary": "Create User View", "operationId": "create_user_view_auth_register_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserIn" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserOut" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/auth/login": { "post": { "tags": [ "auth" ], "summary": "Login View", "operationId": "login_view_auth_login_post", "requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/Body_login_view_auth_login_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Token" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/auth/{id}": { "get": { "tags": [ "auth" ], "summary": "Get User View", "operationId": "get_user_view_auth__id__get", "parameters": [ { "required": true, "schema": { "title": "Id", "type": "integer" }, "name": "id", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserOut" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "OAuth2PasswordBearer": [] } ] } }, "/cards/": { "get": { "tags": [ "cards" ], "summary": "Get all cards.", "operationId": "get_all_cards_view_cards__get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Get All Cards View Cards Get", "type": "array", "items": { "$ref": "#/components/schemas/CardOut" } } } } } }, "security": [ { "OAuth2PasswordBearer": [] } ] }, "post": { "tags": [ "cards" ], "summary": "Create new card.", "operationId": "create_card_view_cards__post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CardIn" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CardOut" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "OAuth2PasswordBearer": [] } ] } }, "/cards/geo": { "get": { "tags": [ "cards" ], "summary": "Get cards sorted by geo.", "operationId": "get_geo_cards_view_cards_geo_get", "parameters": [ { "required": true, "schema": { "title": "Latitude", "type": "number" }, "name": "latitude", "in": "query" }, { "required": true, "schema": { "title": "Longitude", "type": "number" }, "name": "longitude", "in": "query" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Get Geo Cards View Cards Geo Get", "type": "array", "items": { "$ref": "#/components/schemas/CardOut" } } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "OAuth2PasswordBearer": [] } ] } }, "/stores": { "get": { "tags": [ "stores" ], "summary": "Get closest shops.", "operationId": "find_shops_view_stores_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Find Shops View Stores Get", "type": "array", "items": { "$ref": "#/components/schemas/StoreOut" } } } } } }, "security": [ { "OAuth2PasswordBearer": [] } ] } } }, "components": { "schemas": { "Body_login_view_auth_login_post": { "title": "Body_login_view_auth_login_post", "required": [ "username", "password" ], "type": "object", "properties": { "grant_type": { "title": "Grant Type", "pattern": "password", "type": "string" }, "username": { "title": "Username", "type": "string" }, "password": { "title": "Password", "type": "string" }, "scope": { "title": "Scope", "type": "string", "default": "" }, "client_id": { "title": "Client Id", "type": "string" }, "client_secret": { "title": "Client Secret", "type": "string" } } }, "CardIn": { "title": "CardIn", "required": [ "store_id", "code" ], "type": "object", "properties": { "store_id": { "title": "Store Id", "type": "integer" }, "code": { "title": "Code", "type": "integer" } } }, "CardOut": { "title": "CardOut", "required": [ "store_id", "code", "id", "created_at" ], "type": "object", "properties": { "store_id": { "title": "Store Id", "type": "integer" }, "code": { "title": "Code", "type": "integer" }, "id": { "title": "Id", "type": "integer" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" } } }, "HTTPValidationError": { "title": "HTTPValidationError", "type": "object", "properties": { "detail": { "title": "Detail", "type": "array", "items": { "$ref": "#/components/schemas/ValidationError" } } } }, "StoreOut": { "title": "StoreOut", "required": [ "id", "name" ], "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" } } }, "Token": { "title": "Token", "required": [ "access_token", "token_type" ], "type": "object", "properties": { "access_token": { "title": "Access Token", "type": "string" }, "token_type": { "title": "Token Type", "type": "string" } } }, "UserIn": { "title": "UserIn", "required": [ "username", "password" ], "type": "object", "properties": { "username": { "title": "Username", "type": "string" }, "password": { "title": "Password", "type": "string" } } }, "UserOut": { "title": "UserOut", "required": [ "id", "username", "created_at" ], "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "username": { "title": "Username", "type": "string" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" } } }, "ValidationError": { "title": "ValidationError", "required": [ "loc", "msg", "type" ], "type": "object", "properties": { "loc": { "title": "Location", "type": "array", "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] } }, "msg": { "title": "Message", "type": "string" }, "type": { "title": "Error Type", "type": "string" } } } }, "securitySchemes": { "OAuth2PasswordBearer": { "type": "oauth2", "flows": { "password": { "scopes": {}, "tokenUrl": "login" } } } } } }