Skip to content

[Server] Boolean query parameters reject the capitalized spelling a hand-written client sends #1891

Closed as not planned

Description

@moomindani

Describe the bug

Every Optional<Boolean> query parameter on the native REST surface rejects True / False with a 400, although the OpenAPI spec types them boolean. Armeria converts a Boolean parameter through a fixed table of true|TRUE|1 and false|FALSE|0 (com.linecorp.armeria.internal.common.util.StringUtil.stringToBoolean), so a capitalized value never converts. AnnotatedValueResolver is in an internal package, so the conversion cannot be replaced globally.

Ten parameters are affected:

Endpoint Parameter
DELETE /catalogs/{name} force
DELETE /schemas/{full_name} force
DELETE /functions/{name} force
DELETE /models/{full_name} force
DELETE /credentials/{name} force
DELETE /external-locations/{name} force
GET /volumes (both list handlers) include_browse
GET /tables omit_properties, omit_columns

force is the one that matters: it is acted on, it decides whether a delete cascades, and a caller who spells it True gets a 400 instead of the delete they asked for.

To Reproduce

  1. Start a server.

  2. curl -X DELETE 'http://localhost:8080/api/2.1/unity-catalog/catalogs/c?force=True'

    400 {"error_code":"INVALID_ARGUMENT","message":"Can't convert 'True' to type 'Boolean'."}
    
  3. The same request with force=true (or force=1) is accepted.

Measured the same way for include_browse, omit_properties and omit_columns: 400 on True, 200 on true.

True is what a hand-written Python client sends -- requests.delete(url, params={"force": True}) renders the query as force=True. The generated Python client in this repo is not affected, because its parameters_to_url_query lowercases booleans, so this reaches scripts written directly against the REST API.

Expected behavior

A parameter the spec types boolean accepts true and false without regard to case. The values Armeria already converts, 1 and 0 included, keep working, so the accepted set only grows and no existing caller changes.

System

  • Server built from main (0.7.0-SNAPSHOT), macOS, JDK 17.

Additional context

The same defect on the Iceberg REST surface (purgeRequested on dropTable) is fixed in #1890, where it also stops pyiceberg's drop_table and purge_table from working at all. That PR validates the value as a String in the one handler it touches; doing the same for ten parameters wants one shared helper rather than ten copies, which is why this is filed separately. I am happy to send that patch.

Activity

  1. moomindani commented on Sep 21, 2026

    @moomindani
    ContributorAuthor

    Closing as working as intended, per the discussion on #1897: all.yaml is the contract for this
    surface and types these parameters as boolean, which is true/false. True is a client
    serializing a Python bool with str(), and accepting it would add an input the spec does not
    describe -- permanently, and in a form OpenAPI cannot express -- while hiding the client-side bug
    until it meets a spec-conformant validator. The generated clients in this repo already send
    true/false.

    The same defect on the Iceberg REST surface stays fixed in #1890, where the spelling comes from
    pyiceberg itself and the contract being met is the Iceberg REST spec rather than ours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions