Skip to content
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

Support for adhoc parameters on an action post #30

Open
miller79 opened this issue May 3, 2023 · 6 comments
Open

Support for adhoc parameters on an action post #30

miller79 opened this issue May 3, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@miller79
Copy link

miller79 commented May 3, 2023

Sometimes the action is dynamic and unknown until you send the message. It would be good to be able to just add other parameters to send with the request if needed.

@dillonredding
Copy link
Member

dillonredding commented May 3, 2023

What do you mean by "the action is dynamic and unknown"? If an action isn't provided by the server, the client shouldn't be able to submit it.

@miller79
Copy link
Author

miller79 commented May 3, 2023

In a case we support an action but not quite sure all the inputs. For this service I'm working on, there's an action to be able to send a template with fields and it will generate a document. The issue is the fields in the document cannot be known ahead of time so the action only states how to load the document but cannot tell you anything else about it.

@dillonredding
Copy link
Member

Very interesting use case. So, there is input, but the server doesn't know exactly what. Would it not know the fields from the template it's using? If not, how is the client supposed to know them if the server doesn't?

Domain aside, I'm not sure we should support adding arbitrary fields to an action. The server should be telling the client what it expects. Perhaps a special kind of action or field allows this, but I'm hesitant to support it for any action.

@dillonredding
Copy link
Member

@miller79 What if we add support for a new field type that allows for a sequence of name-value pairs? The UI might look something like this, where the label is the field title (or name).

As for the field, the value could be a map of the name to values (the type being Record<string, string[]> where values are arrays to account for duplicate names). The question is then how are these serialized. We could provide a custom serializer, but this feels like something the underlying client library could/should support. So, I created an issue in that repo.

@miller79
Copy link
Author

miller79 commented May 8, 2023

Yeah that's pretty much exactly what I was hoping for.

@dillonredding
Copy link
Member

Then we just need to figure out 1) the name of the field type, and 2) what request the server is expecting (something to discuss here).

@dillonredding dillonredding added the enhancement New feature or request label May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants