-
Notifications
You must be signed in to change notification settings - Fork 14
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
swagger: Add DataProviderCapabilities to swagger documentation #143
swagger: Add DataProviderCapabilities to swagger documentation #143
Conversation
6ca4880
to
ba570ff
Compare
@@ -64,4 +64,11 @@ enum ProviderType { | |||
*/ | |||
@Schema(required = false, description = "Optional input configuration used to create this derived data provider.") | |||
Configuration getConfiguration(); | |||
|
|||
/** | |||
* @return option output capabilities. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
/** | ||
* @return The name. | ||
*/ | ||
@JsonProperty("canCreate") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should each capabilities parameter be independently optional (required=false) or only the parent 'capabilities'?
Or none? I'm not sure what is the intended outcome, the ADR did not have any optional in the javascript example. In the Java code (IDataProviderDescriptor) the capabilities field is not nullable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we should make each one optional. I guess it could save some bytes over the TSP. However, on the client side of the TSP, we would have to handle if fields are not there. Either way, let me know what you prefer. It will affect the related PRs (tsp-typescript-client/tsp-python-client).
BTW, the class DataProviderDescriptorSerializer determines if the capabilities are serialized or not. IDataProviderDescriptor is the Trace Compass internal implementation/API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think we agree to make each subfield optional. It's required=false by default so nothing to change in this file.
/** | ||
* @return The name. | ||
*/ | ||
@JsonProperty("canCreate") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think we agree to make each subfield optional. It's required=false by default so nothing to change in this file.
/** | ||
* @return option output capabilities. | ||
*/ | ||
@Schema(required = false, description = "Optional output capabilities, such as \"canCreate\" and \"canDelete\".") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The required option is false by default, so we can probably omit it everywhere that it's set to false (or leave it to be explicit?).
But it should be added when required = true, I believe in this file it should be added to the fields id, name, description, type. This is how it's currently implemented in tsp-typescript-client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will update the description to make sure that they are optional and what is supposed to happen when omitted. I won't fix the other fields that should have required=true because it should be in a separate PR. I noticed more data structures that need fixing.
ba570ff
to
b2e38b4
Compare
/** | ||
* @return optional output capabilities. | ||
*/ | ||
@Schema(description = "Optional output capabilities, such as \"canCreate\" and \"canDelete\". If omitted, all capabilites are false.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capabilities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
b2e38b4
to
1f583e3
Compare
public interface OutputCapabilities { | ||
|
||
/** | ||
* @return The name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
boolean canCreate(); | ||
|
||
/** | ||
* @return The ID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Bernd Hufmann <[email protected]>
1f583e3
to
ce19b4b
Compare
00a007b
into
eclipse-tracecompass-incubator:master
What it does
This PR adds the DataProviderCapabilities API to the swagger documentation.
See ADR: eclipse-cdt-cloud/theia-trace-extension#1158
How to test
Run trace-server and create the API documentation as described here https://github.com/eclipse-cdt-cloud/trace-server-protocol?tab=readme-ov-file#generate-the-api.
Follow-ups
N/A
Review checklist
Signed-off-by: Bernd Hufmann [email protected]