FastAPI Pydantic This function uses the FastAPI framework to create a random user object containing name, last name, and age. It first checks if the first name and last name are empty, then generates a random age between 18 and 65, and finally returns a new User object. API Endpoints 2024-12-16 12:17:40 26 views
FastAPI Pydantic This code defines a FastAPI endpoint to create a new item. It uses Pydantic for data validation and SQLAlchemy ORM for database interactions. FastAPI Endpoint 2024-12-16 12:17:39 23 views
FastAPI Pydantic This function creates a FastAPI application, defines a User model, stores some random user data, and provides an API endpoint to retrieve a list of users. FastAPI Web Service 2024-12-16 12:17:10 24 views
FastAPI Pydantic This code creates a FastAPI application to retrieve user data. It uses Pydantic to define data models and leverages FastAPI's dependency injection system to fetch data. The type of code 2024-12-16 12:16:23 11 views
FastAPI Pydantic This function creates a FastAPI application, defines a User model, generates 10 random user data, and provides a GET interface to retrieve user data. API service 2024-12-16 12:15:58 12 views
FastAPI random This function creates a FastAPI application that provides an endpoint to return a random user agent string. FastAPI Web Service 2024-12-16 12:15:11 8 views
FastAPI Pydantic This function generates a specified number of random user data using FastAPI's Pydantic library, including user ID, name, age, and email address. Generate random user data 2024-12-16 12:15:04 8 views
FastAPI Pydantic This code defines a FastAPI application that contains a POST endpoint for calculating the discounted price of an item. The user needs to provide the item's name and price, as well as the discount rate. FastAPI API Endpoint 2024-12-16 12:14:39 8 views
FastAPI Pydantic This function takes a dictionary containing item information, parses it into an `Item` model, and then calls the `create_item` function to create the item. If there is a validation error during parsing, it raises an HTTP exception. FastAPI custom function 2024-12-16 12:14:18 6 views
FastAPI Pydantic This function creates an item using FastAPI and Pydantic, handling exceptions that may occur during the item creation process. It accepts a Pydantic model containing item information and returns the created item. If an exception occurs during item creation, it raises an HTTP exception. FastAPI Function 2024-12-16 12:13:40 6 views