Skip to content

feat: adds reusable actions#296

Open
baywet wants to merge 48 commits intoOAI:mainfrom
baywet:feat/action-templates
Open

feat: adds reusable actions#296
baywet wants to merge 48 commits intoOAI:mainfrom
baywet:feat/action-templates

Conversation

@baywet
Copy link
Copy Markdown
Member

@baywet baywet commented Feb 18, 2026

This pull request adds action templates.

fixes #33
fixes #136
fixes #270

closes #238

This is another attempt to solve a scale limitation in the current specification. Action templates are better than the previous parameters proposal because:

  • They do not introduce a matrix projection, people may use the template multiple times.
  • They do not require "declaring" which environment variables to read in advance.
  • They limit the string literal replacement to the templates, which does not impact how actions currently work.
  • The template reference mechanism works like OpenAPI references.
  • The template resolution mechanism can be isolated as a pre-processing step, and the resolved actions can then be fed to the existing code processing actions.
  • It introduces a string literal replacement syntax which can be expanded upon for other sources or used at other places in the future.

The pull request is incomplete as it is, it's a draft, I want to collect feedback on the approach before making any further investments.

@baywet baywet added this to the Release 1.2 milestone Feb 18, 2026
@baywet baywet requested review from handrews, karenetheridge, lornajane, mikekistler, mkistler and ralfhandl and removed request for mkistler February 18, 2026 18:37
@ralfhandl
Copy link
Copy Markdown
Contributor

I like the general direction.

@baywet
Copy link
Copy Markdown
Member Author

baywet commented Feb 24, 2026

Feedback from the meeting from both @lornajane and @ralfhandl :

  • add a peer block to parameters for the environment variables, this allows to set defaults and "declare" which variables are used. But this declaration is optional.
  • add a peer "actions" in the components, that's defined as everything except for the target. So people can specify the target on reference. Reusable actions may use action templates in turns.

Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
@baywet baywet force-pushed the feat/action-templates branch from e709bde to 06a21c9 Compare February 25, 2026 15:19
@baywet baywet changed the title feat: adds action templates feat: adds action templates and reusable actions Feb 25, 2026
Copy link
Copy Markdown
Contributor

@ralfhandl ralfhandl left a comment

Choose a reason for hiding this comment

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

Mostly wording and capitalization

baywet and others added 3 commits February 25, 2026 11:37
Co-authored-by: Ralf Handl <ralf.handl@gmail.com>
Co-authored-by: Ralf Handl <ralf.handl@gmail.com>
Co-authored-by: Ralf Handl <ralf.handl@gmail.com>
@baywet baywet requested a review from ralfhandl February 25, 2026 18:56
baywet added 3 commits March 3, 2026 08:33
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
…rlay-Specification into feat/action-templates

Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
@baywet
Copy link
Copy Markdown
Member Author

baywet commented Mar 3, 2026

@ralfhandl @lornajane I pushed another update a couple of minutes ago. I wasn't happy about the whole reusable actions vs action templates kind of thing. After chatting with @mikekistler internally I realized we could simply define a an action template reference object as "you can override anything from the resolved template in the reference" like JSON schema does to some extent. And keep things extra simple.

Let me know what you think!

@baywet
Copy link
Copy Markdown
Member Author

baywet commented Apr 2, 2026

Finalized the implementation of the current version of the spec over here BinkyLabs/openapi-overlays-dotnet#276

(some LLMs were hurt in the process)

Copy link
Copy Markdown
Contributor

@ralfhandl ralfhandl left a comment

Choose a reason for hiding this comment

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

Only reviewed the examples.

baywet and others added 2 commits April 6, 2026 07:56
Co-authored-by: Ralf Handl <ralf.handl@gmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
@baywet baywet requested a review from ralfhandl April 6, 2026 13:24
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Copy link
Copy Markdown
Contributor

@mikekistler mikekistler left a comment

Choose a reason for hiding this comment

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

I think this is very close now. I left a few more comments about possible improvements.

baywet added 2 commits April 6, 2026 12:50
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Copy link
Copy Markdown
Contributor

@ralfhandl ralfhandl left a comment

Choose a reason for hiding this comment

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

Only minor suggestions

baywet and others added 2 commits April 7, 2026 10:17
Co-authored-by: Ralf Handl <ralf.handl@gmail.com>
Co-authored-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
baywet added 3 commits April 7, 2026 13:47
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
…ect nodes

Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
ralfhandl
ralfhandl previously approved these changes Apr 8, 2026
@baywet
Copy link
Copy Markdown
Member Author

baywet commented Apr 8, 2026

Sharing some number from the refactor on our internal repos: we're seeing about 30% reduction on average. Of course that number highly depends on how repetitive your Overlay document is.

mikekistler
mikekistler previously approved these changes Apr 8, 2026
Copy link
Copy Markdown
Contributor

@mikekistler mikekistler left a comment

Choose a reason for hiding this comment

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

Looks good. 👍

I think this is a valuable addition to Overlays and will help expand their adoption.

I wish we could fix some of the terminology quirks we have discussed -- in particular "Reusable Action Objects" -- but I don't want to make perfect the enemy of the good.

@baywet baywet dismissed handrews’s stale review April 8, 2026 18:25

feedback implemented

Copy link
Copy Markdown
Member

@handrews handrews left a comment

Choose a reason for hiding this comment

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

A few minor comments and questions.

| ---- | :----: | ---- |
| <a name="reusable-action-reference-ref"></a>$ref | `string` | **REQUIRED** A [same-document](https://www.rfc-editor.org/rfc/rfc3986.html#section-4.4) (or fragment-only) relative URI reference, per RFC3986 §4.4, and that the fragment syntax is JSON Pointer, with the pointer prefix restricted to `/components/actions/`. Component action keys in this pointer MUST be encoded according to [[RFC6901], Section 3](https://www.rfc-editor.org/rfc/rfc6901#section-3). |
| <a name="reusable-action-reference-parameter-values></a>parameterValues | `Map(string, string)` | A set of string values to use for the reusable action parameters, the key MUST match the parameter name. Optional. |
| <a name="reusable-action-reference-action-fields"></a>Any field defined in the [Action Object](#action-object) | mixed | Any field defined in the [Action Object](#action-object) to be used as an override to the value resolved in the reusable action. The [string literal replacement syntax](#string-literal-replacement-syntax) MAY NOT be used for any of the fields. Optional. |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems to be missing the field name and type? I see this is true in the other Object where I commented on RFC2119 usage as well? I also don't see a field name in the schema? I am confused here, is this a fixed field, and if so what is its name?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This comment applies to line 218, I apparently missed when selecting lines 🤦

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The goal here was to say something along the lines of: "any field that's defined for the action object, you can also use here", without duplicating those. But if you think a copy paste instead would make the reading easier, I do that instead, what do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please do not duplicate the fields, that will cause trouble later when fields are added to actions and not here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thank you for the input. How do we reword this better so what we mean here is obvious then?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@baywet this feels more like a "Patterned Fields" than a "Fixed Fields"? Also, I'm concerned about embedding an "any field..." in an object with fixed fields. It invites field name collision problems. Can we push this down under a field that would hold all of this stuff in its own namespace?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Aaaah the collision aspect is a good callout (from the operations in OpenAPI) I had not thought out. We could in theory create a "definition" field which would effectively be an Overlay Action Object (with all fields optional, and the string interpolation turned on)

What do you think?

(using definition here for lack of better term, to avoid having another thing called "action")

Copy link
Copy Markdown
Member

@handrews handrews Apr 9, 2026

Choose a reason for hiding this comment

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

Seems like the right general idea, but definition has JSON Schema-ish re-use connotations... you could just call it fields?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure! Always happy to get better name suggestions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure! Always happy to get better name suggestions.

Co-authored-by: Henry Andrews <andrews_henry@yahoo.com>
@baywet baywet dismissed stale reviews from mikekistler and ralfhandl via d0d9f75 April 9, 2026 11:08
| Field Name | Type | Description |
| ---- | :----: | ---- |
| <a name="reusable-action-reference-ref"></a>$ref | `string` | **REQUIRED** A [same-document](https://www.rfc-editor.org/rfc/rfc3986.html#section-4.4) (or fragment-only) relative URI reference, per RFC3986 §4.4, and that the fragment syntax is JSON Pointer, with the pointer prefix restricted to `/components/actions/`. Component action keys in this pointer MUST be encoded according to [[RFC6901], Section 3](https://www.rfc-editor.org/rfc/rfc6901#section-3). |
| <a name="reusable-action-reference-ref"></a>$ref | `string` | **REQUIRED** A [same-document](https://www.rfc-editor.org/rfc/rfc3986.html#section-4.4) (or fragment-only) relative URI reference, per RFC3986 §4.4, where that the fragment syntax is JSON Pointer with the pointer prefix restricted to `/components/actions/`. Component action keys in this pointer MUST be encoded according to [[RFC6901], Section 3](https://www.rfc-editor.org/rfc/rfc6901#section-3). |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

where that the fragment syntax is JSON Pointer

"where the fragment is a JSON Pointer"
(If that is what you mean?)

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.

unsupported use case for dynamic node creation String Interpolation for Update Values Environment Variables in definition

6 participants