Skip to content

fix(codegen): generate Array<Record<string, any>> for {:array, :map} return types#56

Merged
Torkan merged 1 commit intoash-project:mainfrom
barnabasJ:fix-array-map-return-type
Mar 16, 2026
Merged

fix(codegen): generate Array<Record<string, any>> for {:array, :map} return types#56
Torkan merged 1 commit intoash-project:mainfrom
barnabasJ:fix-array-map-return-type

Conversation

@barnabasJ
Copy link
Copy Markdown
Contributor

Summary

  • Actions returning {:array, :map} were incorrectly generating Record<string, any> instead of Array<Record<string, any>> in TypeScript
  • Added :array_of_unconstrained_map variant to ActionIntrospection, following the existing pattern used for :array_of_typed_map, :array_of_typed_struct, etc.
  • Updated all call sites in pipeline.ex, function_core.ex, and result_types.ex to handle the new variant

Test plan

  • Added test for get_custom_data_list action returning {:array, :map}
  • Added regression test verifying non-array Record<string, any> is unchanged
  • Added integration test verifying array of maps is returned correctly at runtime
  • All existing tests pass (1799 tests, 0 failures)
  • TypeScript compilation checks pass (compileGenerated, shouldPass, shouldFail, testZod)
  • mix format, mix credo --strict, mix compile --warnings-as-errors all pass

…return types

Actions returning {:array, :map} were incorrectly generating Record<string, any>
instead of Array<Record<string, any>> in TypeScript. Added :array_of_unconstrained_map
variant following the existing pattern for other array types.
@Torkan Torkan merged commit 7701bc7 into ash-project:main Mar 16, 2026
22 of 23 checks passed
@Torkan
Copy link
Copy Markdown
Collaborator

Torkan commented Mar 16, 2026

Sorry for taking so long @barnabasJ! 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants