Skip to content

Commit 06a21c9

Browse files
committed
feat: adds environment variables template
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
1 parent 5633f57 commit 06a21c9

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

versions/1.2.0-dev.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ This object represents one or more changes to be applied to the target document
182182
| Field Name | Type | Description |
183183
| ---- | :----: | ---- |
184184
| <a name="action-template-parameters"></a>parameters | [[Action template parameter object](#action-template-parameter-object)] | A list of parameters to be used during string literal replacement. Optional. |
185+
| <a name="action-template-environment-variables"></a>environmentVariables | [[Action template parameter object](#action-template-parameter-object)] | A list of environment variables to be used during string literal replacement. Optional. |
185186
| Any field defined in the [action object](#action-object) | mixed | The [string literal replacement syntax](#string-literal-replacement-syntax) MAY be used for any of the fields, and the replacements MUST be evaluated as the template reference is being resolved. |
186187

187188
This object MAY be extended with [Specification Extensions](#specification-extensions).
@@ -774,13 +775,19 @@ components:
774775
properties:
775776
'%param.propertyName%':
776777
type: string
778+
stageName:
779+
type: string
780+
const: '%env.stageName%'
777781
description: Adds an error response to the %param.pathItem% path item %param.operation% operation
778782
parameters:
779783
- name: pathItem
780784
- name: operation
781785
default: get
782786
- name: propertyName
783787
default: errorMessage
788+
environmentVariables:
789+
- name: stageName
790+
default: dev
784791
actions:
785792
- $ref: '#/components/actionTemplates/errorResponse'
786793
parameterValues:
@@ -792,6 +799,8 @@ actions:
792799
propertyName: deleteErrorMessage
793800
```
794801

802+
> Note: in this example, not value is set for the process environment variable "stageName".
803+
795804
###### Result description
796805

797806
```yaml
@@ -813,6 +822,9 @@ paths:
813822
properties:
814823
errorMessage:
815824
type: string
825+
stageName:
826+
type: string
827+
const: dev
816828
/some-items:
817829
delete:
818830
responses:
@@ -826,6 +838,9 @@ paths:
826838
properties:
827839
deleteErrorMessage:
828840
type: string
841+
stageName:
842+
type: string
843+
const: dev
829844
```
830845

831846
### Specification Extensions

0 commit comments

Comments
 (0)