Skip to content

Swagger parameter type always shows as "any" #1576

@github-throwaway

Description

@github-throwaway

Describe the Bug

The swagger UI always shows the parameter type any.

Steps To Reproduce

Steps to reproduce the behavior:

Import-Module Pode

# create a server, and start listening on port 8080
Start-PodeServer {
    Add-PodeEndpoint -Address localhost -Port 8080 -Protocol Http
    Enable-PodeOpenApi
    Add-PodeOAInfo -Title 'MVE API' -Version '1.0.0'
    Enable-PodeOpenApiViewer -Type Swagger -Path '/'
    Add-PodeRoute -Method Get -Path '/ping' -ScriptBlock {
        Write-PodeJsonResponse -Value @{ 
            message   = 'pong'
            timestamp = (Get-Date).ToString('yyyy-MM-dd HH:mm:ss')
        }
    } -PassThru | Set-PodeOARouteInfo -Summary 'Bugs' -Tags 'Bug' -PassThru |
    Set-PodeOARequest -Parameters @(
            (New-PodeOAStringProperty -Name 'hostname' -Description 'hostname' -Required),
            (New-PodeOAIntProperty -Name 'counter' -Description 'number')
    )
}

Expected Behavior

I would expect New-PodeOAIntProperty and New-PodeOAStringProperty to show as an Integer and a String in the swagger definition.

Screenshots

Image

Platform

  • OS: Windows, macOS
  • Browser: Chrome, Arc
  • Versions:
    • Pode: v2.12.1
    • PowerShell: 7.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions