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

Add NoPropertyName Property to Write-PodeXmlResponse #1351

Open mdaneri opened 2 months ago

mdaneri commented 2 months ago

Summary

This PR introduces a new property, NoPropertyName, for the Write-PodeXmlResponse cmdlet. This property modifies the XML output structure by removing the Property elements and using the property names directly within the XML structure.

Changes

Note

HashTable is managed differently from PSObject. Hashtable always returns a string with no properties. This behavior is more in sync with the restful way than ConvertTo-Xml. ConvertTo-Xml is excellent for SOAP, not for Restful.

Benefits

Implementation Details

Usage

To enable the new NoPropertyName feature, set the property to $true when calling Write-PodeXmlResponse:

Write-PodeXmlResponse -NoPropertyName