Azure / Azure/Connectors-NodeJS-SDK

Generator loses array, integer-enum, and allOf root schema shapes

Open
#71 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
0
Forks
4
Avg merge
2d 2m
Merged PRs (30d)
14

Description

## Summary

The TypeScript generator loses root-schema shape for array definitions and emits string literal aliases for integer enums. It also drops fields from composed `allOf` object definitions.

## Same-snapshot evidence

Generated all three languages from one immutable Swagger cache with BPM CodefulSdkGenerator commit `a071c1d1a5cdaa8e43e8a61b7afaf33539d62ea6`. TypeScript SDK baseline: `78fbf23efb2dc7a35782467e2848b2de4ea2d8d7`.

Examples:

- Teams `ChatMessageList` is `type: array` with `ChatMessage` items. TypeScript emits `interface ChatMessageList { [key: string]: unknown }`, losing the collection and element type.
- SigningHub `HandSignature` is `type: integer`, enum `[0,1,2,3,4]`. TypeScript emits `"0" | "1" | "2" | "3" | "4"`, changing numbers into strings.
- Teams `ChannelWithOwnerTeamId` uses `allOf`; composed fields are not preserved.

The same-snapshot catalogue found 47 affected array-root models across 23 connectors, plus integer-enum cases in signinghub and etsy and composition cases in teams and starmind.

## Impact

Generated interfaces lose usable element types, and integer enum values are sent with the wrong JSON primitive type. Composed fields are unavailable.

## Expected

- Array roots should generate typed array aliases.
- Integer enums should remain numeric.
- `allOf` object composition should preserve inherited and inline properties.

## Acceptance criteria

- Add generator tests for array roots, integer enums, and `allOf` composition.
- Add compile-time and serialized-wire assertions for each shape.
- Regenerate affected clients and validate against the same Swagger snapshot.

Contributor guide

Open the contributing guide

Research direction

Start with the TypeScript generator and the immutable Swagger snapshot identified in the issue, then reproduce the ChatMessageList, HandSignature, and ChannelWithOwnerTeamId outputs. Add generator tests covering array roots, integer enums, and allOf composition, including compile-time and serialized-wire assertions. Regenerate affected clients and validate them against the same snapshot.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.