Skip to content

Add object and array values (for responses) #24

@patrickhoogkamer

Description

@patrickhoogkamer

To accommodate documenting objects and arrays in responses we need ObjectValue and ArrayValue. This would solve situations where the default discovery method (everything as strings) throws exceptions, like in #3.

I could think of something like this:

new ObjectValue(
    closure: fn () => $this->resource->amazingObject(),
    structure: [
        'someBoolean' => new BooleanValue(),
        'title' => new StringValue(),
    ],
);

new ArrayValue(
    closure: fn () => $this->resource->arrayItems(),
    structure: [
        new ObjectValue(structure: [
            'value' => new StringValue(),
            'nestedObject' => new ObjectValue(structure: ....),
        ]
    ],
)

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions