lukeautry / tsoa

Build OpenAPI-compliant REST APIs using TypeScript and Node
MIT License
3.45k stars 494 forks source link

Query parameter with union type doesn't produce parameter schema #1473

Closed ikkala closed 10 months ago

ikkala commented 1 year ago

Sorting

Expected Behavior

The following

    @Query()
    test_param: number | string

should produce :

    "test_param": {
        "anyOf": [
            {
                "type": "number",
                "format": "double"
            },
            {
                "type": "string"
            }
        ],
    }

Current Behavior

Following is produced currently:

    {
        "in": "query",
        "name": "test_param",
        "required": true,
        "schema": {}
    }

Note: The union works in case of @Body.

Context (Environment)

Version of the library: 5.1.1 and 6.0.0-rc.3 Version of NodeJS: v20.2.0

github-actions[bot] commented 11 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

ikkala commented 11 months ago

Based on 6.0.0-rc.4 change log, this is still to be fixed.

github-actions[bot] commented 10 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days