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

ResourceExplorer2 unmarshaller for ResourceProperty is missing the Data field #3016

Closed
AesaKamar opened this issue Aug 2, 2023 · 4 comments
Assignees
Labels
bug This issue is a bug.

Comments

@AesaKamar
Copy link

AesaKamar commented Aug 2, 2023

Describe the bug

  • When interacting with the AWS Java SDK for the Resource Explorer,
    • When I explore the resourceProperties in the list of resources in the search result,
      • i.e. SearchResult :: List<Resources> :: List<ResourceProperty>
    • I do not see the Data field bound and unmarshalled into the ResourceProperty object

This prevents me from seeing tags associated with my resources via the SDK, whereas I can see them from the CLI

Expected Behavior

I expect the Java SDK to have all of the same fields as the documentation

In Java SDK

https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-resourceexplorer2/src/main/java/com/amazonaws/services/resourceexplorer2/model/ResourceProperty.java

In AWS docs

https://docs.aws.amazon.com/resource-explorer/latest/apireference/API_ResourceProperty.html

Current Behavior

The Java SDK is missing the Data field in the ResourceProperty object

I do not see a variable to hold the Data field returned by the AWS service
https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-resourceexplorer2/src/main/java/com/amazonaws/services/resourceexplorer2/model/ResourceProperty.java

I also do not see an unmarshaller which visits this node in the response and attempts to bind it

Reproduction Steps

When invoking the resource explorer via the AWS CLI, I can see the Data field present in the response for resources which have tags

aws resource-explorer-2 search --query-string "region:us-east-1" --no-paginate

When using the AwsResourceExplorer2Async client, I am unable to find any methods which interact with the Data field, example in Scala included:

    (client: AWSResourceExplorer2Async)
      .searchAsync(new SearchRequest())
      .get()
      .getResources
      .asScala
      .toList
      .map { resource =>
        resource.getProperties.asScala
          .filter(_.getName == "tags")
          .map { resourceProperty =>
            resourceProperty.getData
          }
      }

The call to resourceProperty.getData does not compile

Possible Solution

I'm not sure why the Java SDK and the listed documentation is different.
I suspect this is an issue with the codegen configuration for this service's data model.

Additional Information/Context

No response

AWS Java SDK version used

1.12.518

JDK version used

openjdk 11.0.13 2021-10-19 LTS OpenJDK Runtime Environment Zulu11.52+13-CA (build 11.0.13+8-LTS) OpenJDK 64-Bit Server VM Zulu11.52+13-CA (build 11.0.13+8-LTS, mixed mode)

Operating System and version

macOS 13.4.1 (c) (22F770820d)

@AesaKamar AesaKamar added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 2, 2023
@debora-ito
Copy link
Member

Hi @AesaKamar Data is a JSON type and the Java SDK v1 does not support Document types.

Java SDK v2 does support it - you can see at the bottom of the ResourceProperty API reference the list of SDKs that support that property - kind of hidden, but it's there.

We recommend you upgrade to use Java SDK v2, but we understand that can be a complex task depending on the case. You can use Java SDK v1 and v2 side by side as an option, we have instructions in our Dev Guide -
https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/migration.html

@debora-ito debora-ito removed the needs-triage This issue or PR still needs to be triaged. label Aug 3, 2023
@debora-ito debora-ito self-assigned this Aug 3, 2023
@debora-ito debora-ito added the closing-soon This issue will close in 2 days unless further comments are made. label Aug 3, 2023
@AesaKamar
Copy link
Author

Thanks for the clear explanation! 🎉

@github-actions github-actions bot removed the closing-soon This issue will close in 2 days unless further comments are made. label Aug 4, 2023
@debora-ito
Copy link
Member

Glad we could help.

@debora-ito debora-ito closed this as not planned Won't fix, can't repro, duplicate, stale Aug 4, 2023
@github-actions
Copy link

github-actions bot commented Aug 4, 2023

COMMENT VISIBILITY WARNING

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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

No branches or pull requests

2 participants