-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add custom participant attribute API backwards compatibilty test #453
Conversation
c03ecea
to
2f470c7
Compare
LGTM. Only comment / questions is whether it is necessary to use UUID for the custom
Can't I call them something useful, like
|
Another question is - when do you use lower versus upper case - what is the difference between these two?
Why is |
Maybe it would also be a good idea to add an example of how to upload this custom participant data to the |
You can, but as mentioned elsewhere, I recommend you to not use CARP core namespaces to rule out any potential conflicts, and just to be clear about id scopes. That said, the The reason they are generated by default is because when using an API exposed through a UI, you wouldn't have to directly interact with any ID. It is much more meaningful to display the prompt the user provided to help them identify which is which. In the API, you hold a reference to the object after deserializing, so no ID is needed either. That said, I am not opposed to an API which optionally allows you to set a custom ID.
That's unfortunately something that leaks out from the implementation. The PascalCase types are types in the codebase using default polymorphic serialization, which just uses the
Yes, but you receive these through the endpoint which tells you what data can be set. Visually, you would use the prompt to discern which is which, but for hardcoded programming scenarios, a known id would indeed be useful. I think there is an example of setting a default attribute id, but I think the operation is the same for custom attributes. Although, you may need to know how to use the 'custom input' data type; that may be missing! I'll see whether I can include an example in this PR. |
I just noticed that although you do receive expected input elements on When you receive known types and you have access to the CARP runtime, you can retrieve the statically defined input types. But, for custom types, you'd need access to the original protocol to discern the input elements (or derived types through which input elements are passed, such as Incorporating support for retrieving |
Currently, there was no coverage for adding custom participant attributes to protocols in the backwards compatibility tests. The test resource also serves as an example on how such a JSON request looks like, which was a request in #451.
2f470c7
to
ecc079a
Compare
I moved the relevant tasks which emerged from this discussion to new issues, and will go ahead and merge this PR. |
Currently, there was no coverage for adding custom participant attributes to protocols in the backwards compatibility tests. The test resource also serves as an example on how such a JSON request looks like, which was a request in #451 .
Example of a protocol with both a default attribute (the server is expected to have the type information available at compile time), and a custom attributes (the type information is provided by the client in the form of an "input element").
The protocol service does not validate
inputDataType
. Only when setting the participant data onParticipationService
, errors will occur if no type information is available for the providedinputDataType
. In the Kotlin APIs, theinputDataType
for custom participant attributes is generated under the namespacedk.cachet.carp.input.custom
with a GUID appended, but, this is currently no requirement for the API.