Skip to content

Commit

Permalink
swagger: update ConfigurationSourceType to provide parameter descriptors
Browse files Browse the repository at this point in the history
The list of ConfigurationParameterDescriptor replaces the list of
QueryParameterKeys. Using just the keys would be too restrictive and
ambiguous for clients to implement.

see also:
eclipse-cdt-cloud/theia-trace-extension#1025

Change-Id: Iec49d2d5d6e6e7e6bc9ee8981c6093417136dcf7
Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/204663
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
  • Loading branch information
bhufmann committed Sep 28, 2023
1 parent 872e92f commit 500ada4
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 4 deletions.
@@ -0,0 +1,47 @@
/*******************************************************************************
* Copyright (c) 2023 Ericsson
*
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/

package org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.model;

import org.eclipse.jdt.annotation.NonNullByDefault;

import io.swagger.v3.oas.annotations.media.Schema;

/**
* Contributes to the model used for TSP swagger-core annotations.
*/
@NonNullByDefault
public interface ConfigurationParameterDescriptor {

/**
* @return the name of the configuration parameter
*/
@Schema(description = "The unique key name of the configuration parameter")
String getKeyName();

/**
* @return the ID for of the configuration parameter
*/
@Schema(description = "The data type hint of the configuration parameter")
String getDataType();

/**
* @return a short description of this configuration parameter
*/
@Schema(description = "Describes the configuration parameter")
String getDescription();

/**
* @return true if parameter is required else false.
*/
@Schema(description = "A flag indicating whether the configuration parameter is required or not")
Boolean isRequired();
}
Expand Up @@ -42,10 +42,10 @@ public interface ConfigurationSourceType {
String getDescription();

/**
* @returns a list of query parameter keys to be passed when creating
* @return a list of query parameter keys to be passed when creating
* configuration instance of this type. Use 'path' key for file
* URIs.
*/
@Schema(description = "A list of query parameter keys to be passed when creating configuration instance of this type. Use 'path' key for file URIs")
List<String> getQueryParameterKeys();
@Schema(description = "A list of configuration parameter descriptors to be passed when creating or updating a configuration instance of this type.")
List<ConfigurationParameterDescriptor> getParameterDescriptors();
}
Expand Up @@ -84,7 +84,7 @@ public Response getConfigurationTypes() {
@Path("/types/{typeId}")
@Produces(MediaType.APPLICATION_JSON)
@Operation(summary = "Get a single configuration source type defined on the server", responses = {
@ApiResponse(responseCode = "200", description = "Returns a single configuration source type", content = @Content(array = @ArraySchema(schema = @Schema(implementation = org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.model.ConfigurationSourceType.class))))
@ApiResponse(responseCode = "200", description = "Returns a single configuration source type", content = @Content(schema = @Schema(implementation = org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.model.ConfigurationSourceType.class)))
})
public Response getConfigurationType(@Parameter(description = CFG_TYPE_ID) @PathParam("typeId") String typeId) {
return Response.status(Status.NOT_IMPLEMENTED).entity("Not Implemented").build(); //$NON-NLS-1$
Expand Down

0 comments on commit 500ada4

Please sign in to comment.