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
865 stars 92 forks source link

Fix for OpenAPI Component Properties, Server Endpoint, and Path Filtering Issues #1420

Closed mdaneri closed 1 month ago

mdaneri commented 1 month ago

Description:

This pull request addresses several issues related to the OpenAPI component schema properties, server endpoints, and path filtering. These changes are related to the issues raised in Issue #1419.

Changes made:

  1. Support for additional properties in New-PodeOAComponentSchemaProperty:

    • Added support for $Example, $Deprecated, $Required, $Nullable, $ReadOnly, and $WriteOnly properties, which were previously missing.
  2. Fix for Add-PodeOAServerEndpoint:

    • Updated the function to ensure that only one local endpoint can be defined. It was incorrectly accepting multiple local endpoints before this fix.
  3. Path Filtering for OpenAPI descriptions:

    • Updated the logic to filter out OpenAPI path definitions that do not match the server endpoint URL.
    • Example:
      • Server Endpoint URL: /api/v3
      • Paths such as /api/v2/test will now be excluded from the OpenAPI description, while valid paths like /api/v3/test will be retained.

Issue reference: