Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 181 - 190 of 4,515 for fromP2 (0.06 seconds)

  1. docs_src/handling_errors/tutorial005_py39.py

    from fastapi import FastAPI, Request
    from fastapi.encoders import jsonable_encoder
    from fastapi.exceptions import RequestValidationError
    from fastapi.responses import JSONResponse
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    @app.exception_handler(RequestValidationError)
    async def validation_exception_handler(request: Request, exc: RequestValidationError):
        return JSONResponse(
            status_code=422,
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 626 bytes
    - Click Count (0)
  2. docs_src/python_types/tutorial011_py39.py

    from datetime import datetime
    from typing import Union
    
    from pydantic import BaseModel
    
    
    class User(BaseModel):
        id: int
        name: str = "John Doe"
        signup_ts: Union[datetime, None] = None
        friends: list[int] = []
    
    
    external_data = {
        "id": "123",
        "signup_ts": "2017-06-01 12:22",
        "friends": [1, "2", b"3"],
    }
    user = User(**external_data)
    print(user)
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Sep 02 15:56:35 GMT 2023
    - 492 bytes
    - Click Count (0)
  3. docs/en/docs/advanced/path-operation-advanced-configuration.md

    ///
    
    ## Exclude from OpenAPI { #exclude-from-openapi }
    
    To exclude a *path operation* from the generated OpenAPI schema (and thus, from the automatic documentation systems), use the parameter `include_in_schema` and set it to `False`:
    
    {* ../../docs_src/path_operation_advanced_configuration/tutorial003_py39.py hl[6] *}
    
    ## Advanced description from docstring { #advanced-description-from-docstring }
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 7.2K bytes
    - Click Count (0)
  4. tests/test_wrapped_method_forward_reference.py

    import functools
    
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    from .forward_reference_type import forwardref_method
    
    
    def passthrough(f):
        @functools.wraps(f)
        def method(*args, **kwargs):
            return f(*args, **kwargs)
    
        return method
    
    
    def test_wrapped_method_type_inference():
        """
        Regression test ensuring that when a method imported from another module
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Dec 02 17:23:14 GMT 2025
    - 997 bytes
    - Click Count (0)
  5. docs_src/additional_responses/tutorial001_py39.py

    from fastapi import FastAPI
    from fastapi.responses import JSONResponse
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        id: str
        value: str
    
    
    class Message(BaseModel):
        message: str
    
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}", response_model=Item, responses={404: {"model": Message}})
    async def read_item(item_id: str):
        if item_id == "foo":
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 506 bytes
    - Click Count (0)
  6. docs_src/schema_extra_example/tutorial003_py39.py

    from typing import Union
    
    from fastapi import Body, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        item_id: int,
        item: Item = Body(
            examples=[
                {
                    "name": "Foo",
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 612 bytes
    - Click Count (0)
  7. tests/test_ambiguous_params.py

    from typing import Annotated
    
    import pytest
    from fastapi import Depends, FastAPI, Path
    from fastapi.param_functions import Query
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    def test_no_annotated_defaults():
        with pytest.raises(
            AssertionError, match="Path parameters cannot have a default value"
        ):
    
            @app.get("/items/{item_id}/")
            async def get_item(item_id: Annotated[int, Path(default=1)]):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 2K bytes
    - Click Count (1)
  8. docs/en/docs/reference/response.md

    You can also use it directly to create an instance of it and return it from your *path operations*.
    
    You can import it directly from `fastapi`:
    
    ```python
    from fastapi import Response
    ```
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 397 bytes
    - Click Count (0)
  9. docs_src/schema_extra_example/tutorial002_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str = Field(examples=["Foo"])
        description: Union[str, None] = Field(default=None, examples=["A very nice Item"])
        price: float = Field(examples=[35.4])
        tax: Union[float, None] = Field(default=None, examples=[3.2])
    
    
    @app.put("/items/{item_id}")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 517 bytes
    - Click Count (0)
  10. compat/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelBuildingResult.java

         *
         * @return The model identifiers from the lineage of models, never {@code null}.
         */
        List<String> getModelIds();
    
        /**
         * Gets the assembled model.
         *
         * @return The assembled model, never {@code null}.
         */
        Model getEffectiveModel();
    
        /**
         * Gets the raw model as it was read from the input model source. Apart from basic validation, the raw model has not
    Created: Sun Dec 28 03:35:09 GMT 2025
    - Last Modified: Tue Feb 25 08:27:34 GMT 2025
    - 4.2K bytes
    - Click Count (0)
Back to Top