Skip to content

Add support for document shapes in the code generator #1882

Open
@stof

Description

@stof

AWS has some services where they accept an arbitrary JSON document (older services with such need were using a string property containing a JSON string, but this causes double JSON encoding when the main serialization is also JSON).
The metadata file represents that as a shape with no member and a document: true property: https://github.com/aws/aws-sdk-php/blob/33f6d393834053b11a5fc10573a211d92e61c2db/src/data/bedrock-runtime/2023-09-30/api-2.json#L970-L974

Looking at official AWS SDKs for other languages (the official PHP SDK does not returned typed responses and so cannot be used as comparison), here is how they represent it:

Based on that analysis and to be idiomatic to PHP, I suggest represent document shapes as a native PHP value and using bool|string|int|float|null|list<mixed>|array<string, mixed> as phpdoc type (bool|string|int|float|null|array as native type).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions