Skip to content
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

docs: add free form properties schema type #3555

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ record DataAddressSchema(
""";
}

@Schema(name = "Properties", additionalProperties = Schema.AdditionalPropertiesValue.TRUE)
record FreeFormPropertiesSchema() {}

@Schema(name = "Policy", description = "ODRL policy", example = PolicySchema.POLICY_EXAMPLE)
record PolicySchema() {
public static final String POLICY_EXAMPLE = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import org.eclipse.edc.api.model.ApiCoreSchema;
import org.eclipse.edc.connector.api.management.configuration.ManagementApiSchema;

import java.util.Map;

import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.CONTEXT;
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.ID;
Expand Down Expand Up @@ -112,8 +110,8 @@ record AssetInputSchema(
@Schema(name = TYPE, example = EDC_ASSET_TYPE)
String type,
@Schema(requiredMode = REQUIRED)
Map<String, Object> properties,
Map<String, Object> privateProperties,
ManagementApiSchema.FreeFormPropertiesSchema properties,
ManagementApiSchema.FreeFormPropertiesSchema privateProperties,
@Schema(requiredMode = REQUIRED)
ManagementApiSchema.DataAddressSchema dataAddress
) {
Expand Down Expand Up @@ -142,8 +140,8 @@ record AssetOutputSchema(
String id,
@Schema(name = TYPE, example = EDC_ASSET_TYPE)
String type,
Map<String, Object> properties,
Map<String, Object> privateProperties,
ManagementApiSchema.FreeFormPropertiesSchema properties,
ManagementApiSchema.FreeFormPropertiesSchema privateProperties,
ManagementApiSchema.DataAddressSchema dataAddress,
long createdAt
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.eclipse.edc.connector.transfer.spi.types.TransferProcess;

import java.util.List;
import java.util.Map;

import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
import static org.eclipse.edc.connector.transfer.spi.types.TransferProcess.TRANSFER_PROCESS_TYPE;
Expand Down Expand Up @@ -140,8 +139,9 @@ record TransferRequestSchema(
@Schema(requiredMode = REQUIRED)
ManagementApiSchema.DataAddressSchema dataDestination,
@Schema(deprecated = true, description = "Deprecated as this field is not used anymore, please use privateProperties instead")
Map<String, String> properties,
Map<String, String> privateProperties,
ManagementApiSchema.FreeFormPropertiesSchema properties,
@Schema(additionalProperties = Schema.AdditionalPropertiesValue.TRUE)
ManagementApiSchema.FreeFormPropertiesSchema privateProperties,
List<ManagementApiSchema.CallbackAddressSchema> callbackAddresses) {

public static final String TRANSFER_REQUEST_EXAMPLE = """
Expand Down Expand Up @@ -185,8 +185,9 @@ record TransferProcessSchema(
String errorDetail,
@Deprecated(since = "0.2.0")
@Schema(deprecated = true)
Map<String, String> properties,
Map<String, Object> privateProperties,
ManagementApiSchema.FreeFormPropertiesSchema properties,
ManagementApiSchema.DataAddressSchema dataDestination,
ManagementApiSchema.FreeFormPropertiesSchema privateProperties,
List<ManagementApiSchema.CallbackAddressSchema> callbackAddresses
) {
public static final String TRANSFER_PROCESS_EXAMPLE = """
Expand Down
Loading