Add flexibility for request.body and expression maps#5
Merged
Conversation
This commit makes sure we can pass any type to the request.body field (it can be either an object, an array, a raw type string/integer/boolean). While here make sure no other properties are valid on the request object.
Let's make the expression maps (Hash of key to values used in outputs,
request.headers and request.query) more flexible by allowing to be any
type (not only strings).
This makes it possible to write:
```
request:
headers:
MY_HEADER: 3
```
(notice that 3 in the yaml above will be interpreted as a number and
not a string, so we wan't the spec to be valid in that case too)
fbraure
reviewed
Mar 4, 2026
| "$ref": "#/definitions/expressionMap" | ||
| } | ||
| } | ||
| "body": true |
There was a problem hiding this comment.
Can you remind me, what is the true for?
I guess the key is required and the value can be anything?
fbraure
approved these changes
Mar 4, 2026
| "$ref": "#/definitions/expressionMap" | ||
| } | ||
| } | ||
| "body": true |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR improves the spec by making it less restrictive in value types for:
request.bodyfields can now be of any type (not only a hash of keyto string values)
request.headers,request.queryand alloutputs) can now have any type ase value (instead of onlystringbefore this change)
It also adds some restriction on the
requestobject:requestobjects have a stricter list of properties (no extraproperties are allowed)
Some example test cases (valid & invalid) were added to test those new
rules.