Pode icon indicating copy to clipboard operation
Pode copied to clipboard

Cannot create recursive schemata using PODE OA cmds

Open plk opened this issue 2 years ago • 0 comments

Describe the Bug

Cannot create recursive/cyclic schemata

Steps To Reproduce

For example:

Add-PodeOAComponentSchema -Name 'StructPart' -Schema @(
   (New-PodeOAStringPropertv -Name 'name),
   (New-PodeOAStringProperty-Name 'type)
   (New-PodeOASchemaPropertv -Name 'children' -Array -Reference 'StructPart'))

Get an error because "StructPart" is undefined while defining itself ...

Expected Behavior

Deferred resolution of references so that recursive schemata are possible.

Screenshots

Platform

  • OS: [e.g. iOS, Windows]
  • Browser: [e.g. Chrome, Safari]
  • Versions:
    • Pode: 2.8.0
    • PowerShell: PS 7.3

Additional Context

This is a common requirement in many schemata and is generally possible in OpenAPI 3

plk avatar Apr 06 '23 18:04 plk