Skip to content
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

Support construction of Document from java POJOs #5484

Open
2 tasks
vivekg-amazon opened this issue Aug 8, 2024 · 1 comment
Open
2 tasks

Support construction of Document from java POJOs #5484

vivekg-amazon opened this issue Aug 8, 2024 · 1 comment
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue

Comments

@vivekg-amazon
Copy link

Describe the feature

Document is a type supported in smithy which can be used to pass unstructured data like json - https://smithy.io/2.0/spec/simple-types.html#document This is an alternative to sending json strings.

However the java AWS SDK support for it requires json to be hand crafted into a document class.

Example Json:

{ "prompt" : "hello" }

needs to be converted as Document as shown below, before it can be passed to an API

Document.fromMap(ImmutableMap.of("prompt", Document.fromString("text"))

It would helpful if Document class provides a helper method fromObject where we can pass a Java POJO (similar to dynamo db enhanced client's bean schema)

Use Case

It is frustrating for customers to create Document objects to send in a json unstructured data in an API request. For example; APIs like Bedrock's Converse takes in Document type which is cumbersome to do in Java. For other languages like python and javascript, you can send in the json object as is.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Java SDK version used

latest

JDK version used

17

Operating System and version

macOs

@vivekg-amazon vivekg-amazon added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 8, 2024
@debora-ito debora-ito added needs-review This issue or PR needs review from the team. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 13, 2024
@debora-ito
Copy link
Member

@vivekg-amazon feature request added to our backlog.

@debora-ito debora-ito added p3 This is a minor priority issue p2 This is a standard priority issue and removed needs-review This issue or PR needs review from the team. p3 This is a minor priority issue labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants