-
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
server: Update query parameters for configurations #70
server: Update query parameters for configurations #70
Conversation
...s/incubator/internal/trace/server/jersey/rest/core/services/ConfigurationManagerService.java
Outdated
Show resolved
Hide resolved
b629159
to
f42d8ec
Compare
5e53655
to
3ca5be9
Compare
.../incubator/trace/server/jersey/rest/core/tests/services/ConfigurationManagerServiceTest.java
Outdated
Show resolved
Hide resolved
.../incubator/trace/server/jersey/rest/core/tests/services/ConfigurationManagerServiceTest.java
Outdated
Show resolved
Hide resolved
897c200
to
81ddcd2
Compare
81ddcd2
to
36cf32a
Compare
36cf32a
to
f4ec830
Compare
@Schema(required = true, description = "Parameters to create a configuration. Use optional key `name` for unique name of the configuration. " | ||
+ "Use optional key `description` to provide a description of the configuration. Use optional key `typeId` to specify the configuration source type. " | ||
+ "The typeId is not required if endpoint URI contains the typeId. Use key `properties` to specify JSON parameters according the JSON schema of" | ||
+ "the corresponding ConfigurationTypeDescriptor. If no JSON schema is used, add the properties directly as key value pairs. Use key `path` for file URI string values.") |
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'm not sure what are pros and cons of describing them here vs. explicitly as in RequestedQueryParameters? I think with the latter they will be shown when expanding the parameters in the generated TSP?
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 understand. Using something RequestedQueryParameters and I tried it. The issues I had is the different ways we supply the custom properties:
- through JSON schema. This requires the properties key.
- directly under parameters (e.g. path for custom XML analysis in global configuration)
I had the following. It works well with 1). Do you know how can we support case 2)?
public interface ConfigurationQueryParameters {
/**
* @return The parameters.
*/
@NonNull
@Schema(required = true)
ConfigurationParameters getParameters();
/**
* No expected properties below, as per current trace-server protocol.
*/
interface ConfigurationParameters {
@JsonProperty("name")
@Schema(description = "Optional, unique name of the configuration. If omitted a unique name will be generated.")
String getName();
@JsonProperty("description")
@Schema(description = "Optional, description of the configuration.")
String getDescription();
@Schema(description = "Optional, typeId of the configuration. Omit if it's part of endpoint URI.")
@JsonProperty("typeId")
String getTypeId();
@JsonProperty("properties")
@Schema(description = "Properties as JSON object as specified in the schema of the corresponding ConfigurationTypeDescriptor. Use key `path` for file URI string values.")
Map<String, Object> getProperties();
}
}
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 'properties' could also be used for global configuration?
It could be as specified in a schema or in a list of paramDescriptors.
We should set the 'required' value for each parameter.
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 'properties' could also be used for global configuration? It could be as specified in a schema or in a list of paramDescriptors. We should set the 'required' value for each parameter.
Sounds good. Thanks for the feedback.
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
f4ec830
to
3798537
Compare
Map<String, Object> parameters = config.getParameters(); | ||
assertNotNull(parameters); | ||
Map<String, Object> jsonMap = config.getParameters(); | ||
assertNotNull(jsonMap); |
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.
These two lines just duplicates of the two lines above them?
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.
good eye. Done.
/** | ||
* @return properties map as defined in the corresponding {@link ConfigurationSourceType} | ||
*/ | ||
String getTypeId(); |
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.
This line should be moved above the javadoc block
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
3798537
to
ff3e1bb
Compare
ConfigurationParameters getParameters(); | ||
|
||
/** | ||
* No expected properties below, as per current trace-server protocol. |
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.
Fix comment
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 properties map as defined in the corresponding {@link ConfigurationSourceType} | ||
*/ | ||
@Schema(required = true, description = "Properties as specified in the schema or list of ConfigurationParameterDescriptor of the corresponding ConfigurationTypeDescriptor.") |
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.
Thinking about it a bit more we should call this parameters
instead of properties
, because the resulting Configuration has a member called parameters
instead of properties. It would be not clear otherwise.
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
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'm OK with that change.
This commit also includes improved swagger updates of related topics. Signed-off-by: Bernd Hufmann <[email protected]>
ff3e1bb
to
db66049
Compare
6b6fd23
into
eclipse-tracecompass-incubator:master
PR based on PR #66, which commits are included.An additional commit is added:
This commit also includes improved swagger updates of related topics.
Signed-off-by: Bernd Hufmann [email protected]