-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add experimental action parameters with interpolation, matrix expansion, and dotted notation (BOO002) #144
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
base: main
Are you sure you want to change the base?
Conversation
- Add ParameterValueSource enum with Inline and Environment members - Add OverlayParameter model with Name, Source, Values, and Separator properties - Add Parameters property to OverlayAction model - Implement serialization for parameters as x-parameters field - Implement deserialization for parameters - Add comprehensive unit tests for serialization and deserialization - Update PublicAPI.Unshipped.txt with new public API surface Co-authored-by: baywet <[email protected]>
…trix expansion (BOO002)
- Add ParameterProcessor for expanding actions with parameter combinations
- Implement string interpolation with ${parameterName} syntax
- Support environment variable sourcing with optional separator
- Support matrix expansion for multi-valued parameters
- Update OverlayDocument to use parameter expansion when applying actions
- Add comprehensive unit tests for all parameter features
- Update README.md with extensive documentation and examples
Co-authored-by: baywet <[email protected]>
- Only serialize source when it's not the default (Inline) - Only serialize separator when it's not null or empty - Update tests to match optimized serialization behavior Co-authored-by: baywet <[email protected]>
- Replace ToString() with static readonly dictionary for ParameterValueSource serialization - Replace Enum.TryParse with static readonly dictionary for deserialization - Use StringComparer.OrdinalIgnoreCase for case-insensitive source value parsing - Improves performance by avoiding reflection Co-authored-by: baywet <[email protected]>
|
@copilot the specification has changed, we need to make a couple of updates to match the changes:
|
…efaultValues - Remove ParameterValueSource enum (no longer in spec) - Remove Source property from OverlayParameter - Rename Values property to DefaultValues - Parameters now always try environment variables first, then fall back to defaultValues - Update ParameterProcessor to reflect new behavior - Update all unit tests to match new API - Update PublicAPI.Unshipped.txt to reflect changes Co-authored-by: baywet <[email protected]>
- Remove references to source property and inline/environment sources - Update examples to use defaultValues instead of values - Clarify that parameters always try environment variables first - Update examples to show proper usage with new API Co-authored-by: baywet <[email protected]>
Addressed in commits 9eee099 and 37479dc:
|
|
@copilot the specification was updated once again, and we need to reflect the changes here:
|
|
@copilot there are additional updates to make that I forgot to mention earlier:
|
…lues to JsonNode - Remove Separator property from OverlayParameter (removed from spec) - Change DefaultValues from List<string> to JsonNode - Add validation: defaultValues must be array of strings OR array of objects with string key/value pairs - Implement validation during both serialization and deserialization - Update ParameterProcessor to extract string values from JsonNode - Remove test for separator functionality - Update all unit tests to use JsonNode.Parse for defaultValues - Add tests for object-based defaultValues - Update README with new examples showing object-based defaultValues - All 90 tests passing Co-authored-by: baywet <[email protected]>
Addressed in commit ff49cfb:
|
Signed-off-by: Vincent Biret <[email protected]>
… (BOO002)
- Add validation for environment variables: must be JSON array of strings or objects with string key/value pairs
- Support dotted notation (${parameterName.key}) to extract specific properties from object values
- Update regex to support ${parameterName.key} syntax
- Refactor to use ParameterValue class to store both string and object representations
- Add 6 new comprehensive tests for environment variable validation and dotted notation
- Update README with examples of environment variable JSON arrays and dotted notation
- All 96 tests passing
Co-authored-by: baywet <[email protected]>
Addressed in commit bc5b586:
|
…github.com/BinkyLabs/openapi-overlays-dotnet into copilot/add-experimental-action-parameters
Signed-off-by: Vincent Biret <[email protected]>
Signed-off-by: Vincent Biret <[email protected]>
Implementation Plan for Experimental Action Parameters (BOO002)
Based on the issue requirements and the updated proposal OAI/Overlay-Specification#238:
OverlayParametermodel class with properties:Parametersproperty (List?) toOverlayActionmodel (marked as experimental BOO002)x-parametersOverlayAction.SerializeAsV1methodOverlayParameterOverlayActionDeserializerto handlex-parameters${parameterName}syntax in action objects${parameterName.key}syntax for dotted notation to extract object propertiesKey Features
Environment-First Parameters: Parameters always attempt to read from environment variables using the parameter name. If the environment variable is not set, the implementation falls back to the
defaultValuesproperty.Environment Variable Validation: Environment variables containing JSON are validated with the same rules as
defaultValues- must be an array of strings or array of objects with string key/value pairs. Invalid structures throwInvalidOperationException.Matrix Expansion: When parameters have multiple values (from environment variables or defaults), actions are automatically expanded into a cartesian product, allowing one action definition to generate multiple variations.
Flexible DefaultValues: The
defaultValuesproperty supports two formats:["dev", "prod"]- for simple string values[{"url": "https://api1.com", "name": "Server1"}]- where each object contains only string key/value pairs, for complex parameter valuesDotted Notation: Support for
${parameterName.key}syntax to extract specific properties from object values. For example,${server.url}extracts the "url" property from a server object. Works with both defaultValues and environment variables.Validation: Both serialization and deserialization validate that
defaultValuesconforms to the allowed structures, throwing exceptions for invalid types or mixed formats.All requirements from the issue have been implemented, tested, and aligned with the latest specification!
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.