Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rename-PodeOADefinitionTag Function #1339

Merged
merged 16 commits into from
Jul 14, 2024
Merged

Add Rename-PodeOADefinitionTag Function #1339

merged 16 commits into from
Jul 14, 2024

Conversation

mdaneri
Copy link
Contributor

@mdaneri mdaneri commented Jun 24, 2024

Description of the Change:
This pull request introduces a new function, Rename-PodeOADefinitionTagName, which allows renaming an existing OpenAPI definition tag in Pode. This enhancement simplifies the management of OpenAPI definition tags and ensures a more streamlined configuration process.

Key Changes:

  • Added Rename-PodeOADefinitionTagName function.
  • The function renames a specified Definition Tag or the default tag if no tag is specified.
  • Ensures that the new tag name does not already exist.
  • Updates the default and selected definition tags if applicable.
  • Throws an error if used within a Select-PodeOADefinition script block.
  • Includes improvements to the way the default OpenAPI definition tag is managed.

Examples:
Renaming a specific OpenAPI definition tag:

Rename-PodeOADefinitionTag -Tag 'v.3' -NewTag 'v.3.0.3'

Renaming the default OpenAPI definition tag:

Rename-PodeOADefinitionTag -NewTag 'NewDefault'

Notes:

  • The function will throw an error if the new tag name already exists.
  • The function cannot be used inside a Select-PodeOADefinition script block.

Pester Tests:
Included Pester tests to validate the functionality:

  • Renaming a specific OpenAPI definition tag.
  • Renaming the default OpenAPI definition tag.
  • Handling errors when the new tag name already exists.
  • Handling errors when used inside a Select-PodeOADefinition script block.

Documentation:
For detailed usage and examples, refer to the documentation file included in the pull request.

src/Private/Context.ps1 Outdated Show resolved Hide resolved
docs/Tutorials/OpenAPI/Overview.md Outdated Show resolved Hide resolved
docs/Tutorials/OpenAPI/6MultipleDefinitions.md Outdated Show resolved Hide resolved
@Badgerati Badgerati added this to the 2.11.0 milestone Jul 10, 2024
src/Public/OpenApi.ps1 Outdated Show resolved Hide resolved
@mdaneri mdaneri changed the title Add Rename-PodeOADefinitionTagName Function Add Rename-PodeOADefinitionTag Function Jul 14, 2024
@Badgerati Badgerati merged commit 357b2d4 into Badgerati:develop Jul 14, 2024
15 of 16 checks passed
@mdaneri mdaneri deleted the OpenAPI-defaultTag-management branch July 14, 2024 20:56
@Badgerati Badgerati mentioned this pull request Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants