Skip to content

FR: nested DTO / complex types #570

@PaulHendriks

Description

@PaulHendriks

It'd be nice if a DTO could contain multiple levels.

For example:

#[OpenApiSchema]
class Nested
{
    public function __construct(
        #[OpenApiSchemaProperty(name: 'name')]
        public string   $name,
        #[OpenApiSchemaProperty(name: 'other', type: 'object')]
        public OtherDto $other
    )
    {
    }
}

At the moment such a class is rendered like this in the SwaggerUI:

Image

OtherDto should also be able to contain multiple level, resulting in a json tree for a a request,

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions