Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add two generation config flags to raise exceptions #744

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Commits on Apr 1, 2023

  1. fix: Make empty response a NoneProperty

    We know the type of this: It's `None`, so we don't need to annotate it
    as `Any`.
    robertschweizer committed Apr 1, 2023
    Configuration menu
    Copy the full SHA
    9df04c9 View commit details
    Browse the repository at this point in the history
  2. fix: Do not cast() unnecessarily

    cast(None, None) made mypy fail after that last commit.
    robertschweizer committed Apr 1, 2023
    Configuration menu
    Copy the full SHA
    43f3a4c View commit details
    Browse the repository at this point in the history
  3. feat: Parse JSON responses without schema

    It makes sense to return the parsed JSON here instead of None.
    robertschweizer committed Apr 1, 2023
    Configuration menu
    Copy the full SHA
    1186955 View commit details
    Browse the repository at this point in the history
  4. fix: Ignore mypy error when returning None

    This was introduced in "fix: Make empty response a `NoneProperty`",
    but is easier to fix now since parsed_responses in
    endpoint_module.py.jinja does not include `Any` response types anymore.
    robertschweizer committed Apr 1, 2023
    Configuration menu
    Copy the full SHA
    5a75e3d View commit details
    Browse the repository at this point in the history
  5. fix: Add None to Response[] generic type

    Also prevents double return type annotations like `Optional[None]`.
    robertschweizer committed Apr 1, 2023
    Configuration menu
    Copy the full SHA
    01908a5 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    afa1de3 View commit details
    Browse the repository at this point in the history
  7. feat: Add two generation config flags to raise exceptions

    raise_on_error_status raises a `httpx.HTTPStatusError` on all error
    response codes without decoding.
    
    raise_on_unexpected_status is identical to the existing
    `Client.raise_on_unexpected_status` runtime setting, but leads to better
    return type annotations.
    robertschweizer committed Apr 1, 2023
    Configuration menu
    Copy the full SHA
    4e213e6 View commit details
    Browse the repository at this point in the history