Skip to content

feat: add support for arrays in workspace parameters #2

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fx
Copy link

@fx fx commented Jun 11, 2025

👋 Needed this to accept arrays to pass a list(string) to a parameter in my template.

  • Modified WorkspaceParametersSchema to accept string or string[] values
  • Updated CoderClient.createWorkspace to handle array parameters by serializing them as JSON strings
  • Added test case for array parameters in action.test.ts
  • Updated README with example of using array parameters
  • Added undici dependency for the build

(Claude wrote it, but I did read it, and it does work 😁.)

- Modified WorkspaceParametersSchema to accept string or string[] values
- Updated CoderClient.createWorkspace to handle array parameters by serializing them as JSON strings
- Added test case for array parameters in action.test.ts
- Updated README with example of using array parameters
- Added undici dependency for the build

This change allows users to pass array values in the parameters YAML,
which is useful for Coder templates that accept JSON-encoded arrays.
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.

1 participant