Skip to content

Commit

Permalink
swagger: Add DataProviderCapabilities to swagger documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
  • Loading branch information
bhufmann committed Jan 21, 2025
1 parent 855feeb commit 1f583e3
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2021 Ericsson
* Copyright (c) 2021, 2025 Ericsson
*
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0 which
Expand Down Expand Up @@ -56,12 +56,19 @@ enum ProviderType {
/**
* @return optional parent Id
*/
@Schema(required = false, description = "Optional parent Id for grouping purposes for example of derived data providers.")
@Schema(description = "Optional parent Id for grouping purposes for example of derived data providers.")
String getParentId();

/**
* @return the input configuration used to create this data provider.
*/
@Schema(required = false, description = "Optional input configuration used to create this derived data provider.")
@Schema(description = "Optional input configuration used to create this derived data provider.")
Configuration getConfiguration();

/**
* @return optional output capabilities.
*/
@Schema(description = "Optional output capabilities, such as 'canCreate' and 'canDelete'. If absent, all capabilities are 'false'.")
OutputCapabilities getCapabilities();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*******************************************************************************
* Copyright (c) 2025 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 com.fasterxml.jackson.annotation.JsonProperty;

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

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

/**
* @return The name.
*/
@JsonProperty("canCreate")
@Schema(description = "Optional, whether this output (data provider) can create derived outputs (data providers). 'false' if absent.")
boolean canCreate();

/**
* @return The ID.
*/
@Schema(description = "Optional, whether this output (data provider) can be deleted. 'false' if absent.")
@JsonProperty("canDelete")
boolean canDelete();
}

0 comments on commit 1f583e3

Please sign in to comment.