Skip to content

Add support for document shapes in the code generator #1882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
stof opened this issue Apr 18, 2025 · 0 comments
Open

Add support for document shapes in the code generator #1882

stof opened this issue Apr 18, 2025 · 0 comments

Comments

@stof
Copy link
Member

stof commented Apr 18, 2025

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant