# Using default values to skip array value

**URL:** <https://forum.serverless.com/t/using-default-values-to-skip-array-value/17126>\
**Category:** Serverless Framework\
**Tags:** aws, security, api-gateway\
**Created:** [May 5, 2022, 10:17am UTC](https://forum.serverless.com/t/using-default-values-to-skip-array-value/17126 "2022-05-05T10:17:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SebVen](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/sebven/32/6803_2.png) [@SebVen](https://forum.serverless.com/u/SebVen)\
**Post date:** [May 5, 2022, 10:17am UTC](https://forum.serverless.com/t/using-default-values-to-skip-array-value/17126/1 "2022-05-05T10:17:32Z")

</div>

This post is inspired by the following one on stackoverflow: [amazon web services - Use stage parameters to skip fields in Serverless Framework - Stack Overflow](https://stackoverflow.com/questions/72059713/use-stage-parameters-to-skip-fields-in-serverless-framework)

In the code below, is there a particular `'default value'` that could be set as to skip the array value? I would like `DevKey1` and `DevKey2` for the `dev` stage and only `ProdKey1` for the `v1` stage.

```auto
frameworkVersion: '3'

params:
  dev:
    name: 'dev'
    keyName1: DevKey1
    keyName2: DevKey2
  v1:
    name: 'v1'
    keyName1: ProdKey1

provider:
  name: aws
  apiGateway:
    apiKeys:
      - ${param:keyName1}
      - ${param:keyName2, 'defult value'}

```

---

<div class="post-metadata">

**Author:** ![beenmeckel](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@beenmeckel](https://forum.serverless.com/u/beenmeckel)\
**Post date:** [August 16, 2024, 10:09pm UTC](https://forum.serverless.com/t/using-default-values-to-skip-array-value/17126/4 "2024-08-16T22:09:26Z")

</div>

I vaguely remember that they aren’t quite possible with the lazy class loading and method binding. Essentially the bytecode needs to know the exact signature of the method you call and that messes this up somehow

[snaptube](https://snaptube.cam/)[vidmate](https://vidmate.bid/)
