Skip to content

Missing support for JSON serialization of "document" shapes #270

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
GaspardP opened this issue May 6, 2025 · 0 comments
Open

Missing support for JSON serialization of "document" shapes #270

GaspardP opened this issue May 6, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@GaspardP
Copy link

GaspardP commented May 6, 2025

Hi. I found a similar issue solved in #232, but this time it's the serialization of data that's missing.

AWS has added a few shapes with the :document true field in the bedrock-runtime API (I haven't checked the other APIs for similar cases). For reference:

:ModelInputPayload {:type "structure", :members {}, :document true, :sensitive true}
:Document {:type "structure", :members {}, :document true}}

Here is an example for the expected behavior. Currently, the call to shape.json-serialize incorrectly returns "{}".

(deftest test-json-serialize
  (is (= "{\"this\":\"is\",\"a\":\"doc\"}"
         (shape/json-serialize {}
                               {:type "structure", :members {}, :document true}
                               {:this "is" :a "doc"}))))
@scottbale scottbale added the bug Something isn't working label May 7, 2025
@scottbale scottbale self-assigned this May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants