Code generation From API Swagger Yaml schema to PowerShell module in 4 easy steps
summary
YAML OpenAPI schemas become a published PowerShell module by running Swagger Codegen, generating a C# client and PowerShell stubs, pre-processing refs to dereference models, and rendering Jinja2 templates that initialize complex objects so users call New/Remove-style cmdlets instead of raw Invoke operations. The pipeline handles 150+ paths, produces PSD1 and DLL wiring, and runs generation in seconds per spec, producing a working module with more PowerShell‑friendly verbs and parameter initialization.
AI-written summary · about
chapters (17)
- 0:00Code generation intro
- 1:29Pure Storage SDK overview
- 3:57OpenAPI and Swagger
- 6:28Manual SDK inefficiency
- 6:50Code generation tech
- 8:15Pet Store example
- 9:19Swagger Codegen + Mustache
- 13:58Generated module limits
- 16:29Improving user experience with template customization
- 18:57Jinja2 for code generation
- 19:41Pure Storage workflow
- 26:24Preprocess YAML files
- 31:48Complex YAML parameters
- 33:35Render PowerShell scripts
- 37:12Demo of generated module
- 45:01Four-step recap
- 46:05Performance and next steps
related talks
47mPowerShell + AutoRest + Swagger = Instant Modules
47mThink Abstract, abstracting your PowerShell code
47mAutoRest: The Module Generator
33mA self-describing API
53mUncovering Swagger/OpenAPI
57mOpenAPI & .NET: You're Doing It Wrong
48mAPIs are for Automata, PowerShell is for People
46mUsing Automation To Elevate Your Code Creation
