-
Notifications
You must be signed in to change notification settings - Fork 28
feat: adds a parameter object for the action object #238
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
baywet
wants to merge
14
commits into
OAI:main
Choose a base branch
from
baywet:feat/interpolation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+204
−0
Open
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3ec7b0d
feat: adds parameters for actions
baywet 9c32a1f
tests: adds failing tests for parameter object
baywet 8979e9f
tests: adds pass tests for parameter object
baywet 1ed3eb3
Merge branch 'main' into feat/interpolation
baywet 84ef0ba
docs: simplifies to default values
baywet be51b60
Merge branch 'feat/interpolation' of https://github.com/baywet/Overla…
baywet daaa64e
tests: removes extraneous source
baywet 8e74d35
docs: removes the separator
baywet a10b0dc
tests: updates test values for the parameter separator removal
baywet 1ae6e32
Update versions/1.1.0-dev.md
baywet 0f15483
Update versions/1.1.0-dev.md
baywet 89eb5af
Update versions/1.1.0-dev.md
baywet 012debd
nit: plural vs singular
baywet 68e13ea
fix: missing property name
baywet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/v1.1-dev/fail/parameters-environment-with-values.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| overlay: 1.1.0 | ||
| info: | ||
| title: Invalid Parameters - Environment Source with Values | ||
| version: 1.0.0 | ||
| actions: | ||
| - target: $.paths.*.get | ||
| parameters: | ||
| - name: testParam | ||
| source: environment | ||
| values: | ||
| - "value1" | ||
| - "value2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| overlay: 1.1.0 | ||
| info: | ||
| title: Invalid Parameters - Inline Source without Values | ||
| version: 1.0.0 | ||
| actions: | ||
| - target: $.paths.*.get | ||
| parameters: | ||
| - name: testParam | ||
| source: inline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| overlay: 1.1.0 | ||
| info: | ||
| title: Invalid Parameters - Inline Source with Separator | ||
| version: 1.0.0 | ||
| actions: | ||
| - target: $.paths.*.get | ||
| parameters: | ||
| - name: testParam | ||
| source: inline | ||
| separator: "," | ||
| values: | ||
| - "value1" | ||
| - "value2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| overlay: 1.1.0 | ||
| info: | ||
| title: Invalid Parameters - Missing Name | ||
| version: 1.0.0 | ||
| actions: | ||
| - target: $.paths.*.get | ||
| parameters: | ||
| - source: inline | ||
| values: | ||
| - "value1" | ||
| - "value2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| overlay: 1.1.0 | ||
| info: | ||
| title: Valid Parameters - Environment Source | ||
| version: 1.0.0 | ||
| actions: | ||
| - target: $.paths.*.get | ||
| parameters: | ||
| - name: envParam | ||
| source: environment |
10 changes: 10 additions & 0 deletions
10
tests/v1.1-dev/pass/parameters-environment-with-separator.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| overlay: 1.1.0 | ||
| info: | ||
| title: Valid Parameters - Environment Source with Separator | ||
| version: 1.0.0 | ||
| actions: | ||
| - target: $.paths.*.get | ||
| parameters: | ||
| - name: envParamWithSep | ||
| source: environment | ||
| separator: "," |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| overlay: 1.1.0 | ||
| info: | ||
| title: Valid Parameters - Inline Source | ||
| version: 1.0.0 | ||
| actions: | ||
| - target: $.paths.*.get | ||
| parameters: | ||
| - name: param1 | ||
| source: inline | ||
| values: | ||
| - "value1" | ||
| - "value2" | ||
| - "value3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| overlay: 1.1.0 | ||
| info: | ||
| title: Valid Parameters - Multiple Parameters | ||
| version: 1.0.0 | ||
| actions: | ||
| - target: $.paths.*.get | ||
| parameters: | ||
| - name: inlineParam | ||
| source: inline | ||
| values: | ||
| - "dev" | ||
| - "staging" | ||
| - "prod" | ||
| - name: envParam1 | ||
| source: environment | ||
| - name: envParam2 | ||
| source: environment | ||
| separator: ";" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| overlay: 1.1.0 | ||
| info: | ||
| title: Valid Parameters - With Extensions | ||
| version: 1.0.0 | ||
| actions: | ||
| - target: $.paths.*.get | ||
| parameters: | ||
| - name: paramWithExt | ||
| source: inline | ||
| values: | ||
| - "value1" | ||
| - "value2" | ||
| x-custom-extension: "custom value" | ||
| x-another-extension: 42 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why local to an action and not global to allow use across multiple related actions, for example when applying traits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like @ralfhandl 's suggestion to make these global rather than within the action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why I didn't make the parameters global is because having the parameters on the action makes it easy for any implementer to detect parameters are used for any given action and expansion is required.
If we want to make global parameters a thing, I think we then need to introduce a parameter reference mechanism. Where we'd mandate that the action has a reference entry for a global parameter to be used and for the expansion + interpolation to happen.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that: parameters are global, and need to be referenced by actions that use them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we going to make parameters global and use/reference/import them in the actions?
If the values are provided in env variables, their names are global anyway, and same name means same value(s).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm open to it. What do we want the references to look like? we could use the $ref syntax so it feels familiar, and it opens the door to having more kinds of references, external references, etc... in the future if we need to. But the downside is that it's a bit verbose and might bring in much more than we need (again, external references, etc...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn’t use
$refand simply reference by name:parametersis an array of parameter definition objectsparametersis an array of parameter namesSimilar to the
tagskeyword in OpenAPI.Or use different keywords, for example
usedParametersin actions.