Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 460 for items (0.15 sec)

  1. tests/test_infer_param_optionality.py

        else:
            return [{"item_id": "i2", "user_id": user_id}]
    
    
    @item_router.get("/{item_id}")
    def get_item(item_id: str, user_id: Optional[str] = None):
        if user_id is None:
            return {"item_id": item_id}
        else:
            return {"item_id": item_id, "user_id": user_id}
    
    
    app.include_router(user_router, prefix="/users")
    app.include_router(item_router, prefix="/items")
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 13.3K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_dataclasses/test_tutorial003.py

            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/authors/{author_id}/items/": {
                    "post": {
                        "summary": "Create Author Items",
                        "operationId": "create_author_items_authors__author_id__items__post",
                        "parameters": [
                            {
                                "required": True,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 12.1K bytes
    - Viewed (0)
  3. tests/test_openapi_separate_input_output_schemas.py

        @app.post("/items/")
        def create_item(item: Item):
            return item
    
        @app.post("/items-list/")
        def create_item_list(item: List[Item]):
            return item
    
        @app.get("/items/")
        def read_items() -> List[Item]:
            return [
                Item(
                    name="Portal Gun",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 18.4K bytes
    - Viewed (2)
  4. tests/test_extra_routes.py

    def delete_item(item_id: str, item: Item):
        return {"item_id": item_id, "item": item}
    
    
    @app.head("/items/{item_id}")
    def head_item(item_id: str):
        return JSONResponse(None, headers={"x-fastapi-item-id": item_id})
    
    
    @app.options("/items/{item_id}")
    def options_item(item_id: str):
        return JSONResponse(None, headers={"x-fastapi-item-id": item_id})
    
    
    @app.patch("/items/{item_id}")
    def patch_item(item_id: str, item: Item):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_bigger_applications/test_main.py

                },
                "/items/{item_id}": {
                    "get": {
                        "tags": ["items"],
                        "summary": "Read Item",
                        "operationId": "read_item_items__item_id__get",
                        "parameters": [
                            {
                                "required": True,
                                "schema": {"title": "Item Id", "type": "string"},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 24.6K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py39.py

    @needs_pydanticv1
    def test_create_item(client):
        item = {"title": "Foo", "description": "Something that fights"}
        response = client.post("/users/1/items/", json=item)
        assert response.status_code == 200, response.text
        item_data = response.json()
        assert item["title"] == item_data["title"]
        assert item["description"] == item_data["description"]
        assert "id" in item_data
        assert "owner_id" in item_data
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_sql_databases/test_sql_databases_py310.py

    @needs_pydanticv1
    def test_create_item(client):
        item = {"title": "Foo", "description": "Something that fights"}
        response = client.post("/users/1/items/", json=item)
        assert response.status_code == 200, response.text
        item_data = response.json()
        assert item["title"] == item_data["title"]
        assert item["description"] == item_data["description"]
        assert "id" in item_data
        assert "owner_id" in item_data
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_sql_databases/test_sql_databases_py39.py

    @needs_pydanticv1
    def test_create_item(client):
        item = {"title": "Foo", "description": "Something that fights"}
        response = client.post("/users/1/items/", json=item)
        assert response.status_code == 200, response.text
        item_data = response.json()
        assert item["title"] == item_data["title"]
        assert item["description"] == item_data["description"]
        assert "id" in item_data
        assert "owner_id" in item_data
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  9. docs/de/docs/tutorial/bigger-applications.md

    * Suche nach dem Subpackage `routers` (das Verzeichnis unter `app/routers/`) ...
    * und importiere daraus die Submodule `items` (die Datei unter `app/routers/items.py`) und `users` (die Datei unter `app/routers/users.py`) ...
    
    Das Modul `items` verfügt über eine Variable `router` (`items.router`). Das ist dieselbe, die wir in der Datei `app/routers/items.py` erstellt haben, es ist ein `APIRouter`-Objekt.
    
    Und dann machen wir das gleiche für das Modul `users`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:27:59 GMT 2024
    - 21.1K bytes
    - Viewed (0)
  10. guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java

       */
      private E extract() {
        final E[] items = this.items;
        E x = items[takeIndex];
        items[takeIndex] = null;
        takeIndex = inc(takeIndex);
        --count;
        return x;
      }
    
      /**
       * Utility for remove and iterator.remove: Delete item at position i. Call only when occupying
       * monitor.
       */
      void removeAt(int i) {
        final E[] items = this.items;
        // if removing front item, just advance
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 22.5K bytes
    - Viewed (0)
Back to top