Badgerati / Pode

Pode is a Cross-Platform PowerShell web framework for creating REST APIs, Web Sites, and TCP/SMTP servers
https://badgerati.github.io/Pode
MIT License
862 stars 92 forks source link

OpenAPI route parameter definitions issue in v2.11.1 #1450

Open jsg91 opened 1 week ago

jsg91 commented 1 week ago

Describe the Bug

Not sure where the issue lies, the example from the documentation works in v2.11.0 but no longer in v2.11.1.

Steps To Reproduce

  1. Copy https://badgerati.github.io/Pode/Tutorials/OpenAPI/1Overview/#requests -> Parameters-> first example to your v2.11.1 instance
  2. Check OpenAPI definition (/docs/openapi), it won't be there
  3. Change to v2.11.0, it will be there ... no Error to be found anywhere (at least with IIS and ErrorLog catches everywhere)

Expected Behavior

OpenAPI definition won't include that route in v2.11.1, while does in v2.11.0

Platform

PowerShell 7.4.5 w IIS

mdaneri commented 3 days ago

Fixed by #1454

if you need a quick fix, change line 455 of the file public/Route.ps1:

if ($PodeContext.Server.OpenAPI.Routes -notcontains $OpenApiPath ) {
    $PodeContext.Server.OpenAPI.Routes += $OpenApiPath
}

To:

if ($PodeContext.Server.OpenAPI.Routes -notcontains $Path ) {
    $PodeContext.Server.OpenAPI.Routes += $Path
}