Skip to content

Add flexibility for request.body and expression maps#5

Merged
paulRbr merged 3 commits into
bump-sh:mainfrom
paulRbr:relax-request-body-object
Mar 4, 2026
Merged

Add flexibility for request.body and expression maps#5
paulRbr merged 3 commits into
bump-sh:mainfrom
paulRbr:relax-request-body-object

Conversation

@paulRbr

@paulRbr paulRbr commented Mar 4, 2026

Copy link
Copy Markdown
Member

This PR improves the spec by making it less restrictive in value types for:

  • request.body fields can now be of any type (not only a hash of key
    to string values)
  • expression maps (used in request.headers, request.query and all
    outputs) can now have any type ase value (instead of only string
    before this change)

It also adds some restriction on the request object:

  • request objects have a stricter list of properties (no extra
    properties are allowed)

Some example test cases (valid & invalid) were added to test those new
rules.

paulRbr added 3 commits March 4, 2026 16:10
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)
"$ref": "#/definitions/expressionMap"
}
}
"body": true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remind me, what is the true for?
I guess the key is required and the value can be anything?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what you've described. Sorry

@fbraure fbraure left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

"$ref": "#/definitions/expressionMap"
}
}
"body": true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what you've described. Sorry

@paulRbr paulRbr merged commit bb245e0 into bump-sh:main Mar 4, 2026
2 checks passed
@paulRbr paulRbr deleted the relax-request-body-object branch March 5, 2026 08:22
@Polo2 Polo2 mentioned this pull request Mar 13, 2026
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.

2 participants