aws / aws/aws-pdk

[BUG] (type-safe-api) array responses produce broken code

Open
#866 3 comments 0 reactions 0 assignees View on GitHub
backlog bug needs-triage
Dominant language
TypeScript
Stars
451
Forks
84
Avg merge
20h 3m
Merged PRs (30d)
1

Description

### Describe the bug

Returning an array as the top level response from an operation causes code to be generated which does not compile.

### Expected Behavior

Working code.

### Current Behavior

Broken code eg:

```ts
const marshal = (statusCode: number, responseBody: any): string => {
let marshalledBody = responseBody;
switch(statusCode) {
case 200:
marshalledBody = JSON.stringify(ArrayToJSON(marshalledBody));
break;
```

### Reproduction Steps

Use spec from https://github.com/aws/aws-pdk/issues/863

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### PDK version used

0.23.70

### What languages are you seeing this issue on?

Typescript, Java, Python

### Environment details (OS name and version, etc.)

osx

Contributor guide

Open the contributing guide

Research direction

Start with the reproduction spec referenced in issue #863 and generate the TypeScript, Java, and Python outputs for an operation whose top-level response is an array. Compare the generated response marshalling with the failing TypeScript example; done means all generated outputs compile and correctly serialize array responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, python, typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.