Swagger API - Authentication?

Product: PowerShell Universal
Version: 3.7.9


Ive created a new API that looks like this:

#region PSUHeader 
class SourceDatabase {
New-PSUEndpoint -Url "/api/sql/dbcopy/v1/CopyDbFromProdToTest" -Description "Copies database from prod to test" -Method @('POST') -Endpoint {
Copies a database from prod to test

Copies a database from prod to test

        Description: This is an output value. 
            application/json: SourceDatabase

        Description: Invalid input
    Required: true
    Description: This is an input value.
        application/json: SourceDatabase

    [Parameter(Mandatory = $true)]    
    [ValidateSet("Jira_Prod", "Bitbucket_prod", ErrorMessage = "Invalid database name")]
} -Authentication -Role @('SQLDBCopyUsers') -Tag @('beta')

The swagger documentation looks perfect and works really well, but only if i disable authentication on that endpoint.

I cant seem to locate in the documentation, how to add a “authorize” button on the documentation site - like with https://petstore.swagger.io/

Any ideas?

1 Like

Same for me, any ideas?

This looks like a bug on our end. We likely haven’t configured the document to include the fact it requires auth