Search Options

Results per page
Sort
Preferred Languages
Advance

Results 211 - 220 of 922 for Optional (0.26 sec)

  1. tests/test_security_oauth2_authorization_code_bearer.py

    from typing import Optional
    
    from fastapi import FastAPI, Security
    from fastapi.security import OAuth2AuthorizationCodeBearer
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2AuthorizationCodeBearer(
        authorizationUrl="authorize", tokenUrl="token", auto_error=True
    )
    
    
    @app.get("/items/")
    async def read_items(token: Optional[str] = Security(oauth2_scheme)):
        return {"token": token}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/base/MoreObjects.java

       * Predicates.notNull())}, static importing as necessary.
       *
       * <p><b>Note:</b> if {@code first} is represented as an {@link Optional}, this can be
       * accomplished with {@link Optional#or(Object) first.or(second)}. That approach also allows for
       * lazy evaluation of the fallback instance, using {@link Optional#or(Supplier)
       * first.or(supplier)}.
       *
       * <p><b>Java 9 users:</b> use {@code java.util.Objects.requireNonNullElse(first, second)}
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 10 15:41:27 UTC 2024
    - 16.1K bytes
    - Viewed (0)
  3. api/maven-api-core/src/main/java/org/apache/maven/api/PathType.java

                return "UNRESOLVED";
            }
    
            @Override
            public String id() {
                return "UNRESOLVED";
            }
    
            @Override
            public Optional<String> option() {
                return Optional.empty();
            }
    
            @Override
            public String[] option(Iterable<? extends Path> paths) {
                return new String[0];
            }
        };
    
        /**
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Sat Sep 28 09:03:24 UTC 2024
    - 5K bytes
    - Viewed (0)
  4. docs_src/separate_openapi_schemas/tutorial002_py39.py

    from typing import Optional
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: Optional[str] = None
    
    
    app = FastAPI(separate_input_output_schemas=False)
    
    
    @app.post("/items/")
    def create_item(item: Item):
        return item
    
    
    @app.get("/items/")
    def read_items() -> list[Item]:
        return [
            Item(
                name="Portal Gun",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 25 19:10:22 UTC 2023
    - 518 bytes
    - Viewed (0)
  5. tests/test_callable_endpoint.py

    from functools import partial
    from typing import Optional
    
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    
    def main(some_arg, q: Optional[str] = None):
        return {"some_arg": some_arg, "q": q}
    
    
    endpoint = partial(main, "foo")
    
    app = FastAPI()
    
    app.get("/")(endpoint)
    
    
    client = TestClient(app)
    
    
    def test_partial():
        response = client.get("/?q=bar")
        data = response.json()
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Jun 28 18:13:30 UTC 2020
    - 457 bytes
    - Viewed (0)
  6. compat/maven-compat/src/test/resources/inheritance-repo/t08/p0/p1/pom.xml

          </dependency>
          <dependency>
            <groupId>maven-test</groupId>
            <artifactId>t08-d</artifactId>
            <version>1.0</version>
            <scope>test</scope>
            <optional>true</optional>
          </dependency>
        </dependencies>
      </dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>maven-test</groupId>
          <artifactId>t08-a</artifactId>
          <version>1.0</version>
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  7. guava/src/com/google/common/base/Enums.java

        } catch (NoSuchFieldException impossible) {
          throw new AssertionError(impossible);
        }
      }
    
      /**
       * Returns an optional enum constant for the given type, using {@link Enum#valueOf}. If the
       * constant does not exist, {@link Optional#absent} is returned. A common use case is for parsing
       * user input or falling back to a default enum constant. For example, {@code
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri May 26 11:56:44 UTC 2023
    - 5K bytes
    - Viewed (0)
  8. tests/test_security_oauth2_password_bearer_optional_description.py

    from typing import Optional
    
    from fastapi import FastAPI, Security
    from fastapi.security import OAuth2PasswordBearer
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2PasswordBearer(
        tokenUrl="/token",
        description="OAuth2PasswordBearer security scheme",
        auto_error=False,
    )
    
    
    @app.get("/items/")
    async def read_items(token: Optional[str] = Security(oauth2_scheme)):
        if token is None:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  9. compat/maven-compat/src/test/resources/inheritance-repo/t05/maven-test/poms/t05-b-2.0.pom

        </dependency>
        <dependency>
          <groupId>maven-test</groupId>
          <artifactId>t05-d</artifactId>
          <version>1.1</version>
          <type>jar</type>
          <scope>compile</scope>
          <optional>false</optional>
        </dependency>
      </dependencies>
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 622 bytes
    - Viewed (0)
  10. compat/maven-compat/src/test/resources/inheritance-repo/t08/maven-test/poms/t08-b-1.0.pom

        </dependency>
        <dependency>
          <groupId>maven-test</groupId>
          <artifactId>t08-d</artifactId>
          <version>1.1</version>
          <type>jar</type>
          <scope>compile</scope>
          <optional>false</optional>
        </dependency>
      </dependencies>
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 622 bytes
    - Viewed (0)
Back to top