aws / aws/aws-sdk-java-v2

SDK doesn't parse endpoint connection state correctly

Open
#6,382 1 comment 0 reactions 0 assignees View on GitHub
bug p2 service:ec2
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

Description

### Describe the bug

I have a vpc endpoint connection with state pending acceptance, but when I access the state value in the SDK result it returns UNKNOWN_TO_SDK_VERSION. It seems that the problem is caused by the SDK expecting the state value to have pascal case while it actually has camel case. When I parse the response from a string manually using the vpcEndpointStateAsString method with a camel case parser it works for me, but I'd like to be able to used the SDK enum values instead of parsing the string myself. There is a related issue in the old rust AWS SDK repo here https://github.com/aws/aws-sdk/issues/360. This is the state enum in the `service-2.json` file.
```
"State":{
"type":"string",
"enum":[
"PendingAcceptance",
"Pending",
"Available",
"Deleting",
"Deleted",
"Rejected",
"Failed",
"Expired",
"Partial"
]
}
```

As I understand it this is used to generate the string representation of the state enum used when the sdk parses the value. I imagine that the solution is for this enum to be updated to match the values used by the API.

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Expected Behavior

I expected the SDK to return the PENDING_ACCEPTANCE value of the State enum for a VpcEndpointConnection with state pending acceptance that I looked up on the API.

### Current Behavior

The SDK returned UNKNOWN_TO_SDK_VERSION.

### Reproduction Steps

Create a vpc endpoint connection and use the describeVpcEndpointConnections method to query it from the AWS API. The state will be incorrectly parsed as UNKNOWN_TO_SDK_VERSION.

### Possible Solution

It seems to me that the file service-2.json is used in codegen for the SDK. If that's correct a possible solution may be to update the values of the State enum for a VpcEndpointConnection to be camel case so that they match the values returned by the API.

### Additional Information/Context

_No response_

### AWS Java SDK version used

2.32.30

### JDK version used

21

### Operating System and version

Debian linux

Contributor guide

Open the contributing guide

Research direction

Start with the VpcEndpointConnection State enum in service-2.json and trace the generated enum string parser used by describeVpcEndpointConnections. Compare the API's camel-case pending acceptance value with the generated mappings; done means the SDK returns PENDING_ACCEPTANCE instead of UNKNOWN_TO_SDK_VERSION, verified against the reported reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.