fix: Invalid slot type and templated parameters - #10
Open
Derugon wants to merge 3 commits into
Open
Conversation
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.
Issue
A few modules use templated parameters to let users specify a variable number of structured arguments.
For example, the
action=compareAPI uses 2 sets of templated parameters (from…andto…) to specify additional parameters for one or more sources and targets:These are defined by:
slotsparameter to specify a set of identifiers (e.g.fromslots: ["foo", "bar"],"fromtext-foo": "Foo text", "fromtext-bar": "Bar text").However, templated parameters are currently not included in interfaces, and slot types only allow an extremely limited set of values.
For example, the following parameters are generated for
ApiComparePagesParams:Proposed changes
In this PR, as a first step, templated parameters are generated using template literal types, ensuring properly-prefixed parameters have the correct types.
For example, the following parameters are generated for
ApiComparePagesParams:This could be improved further, as this approach does not ensure parameter name suffixes are synchronized with each other.