Skip to content

Commit

Permalink
docs: add a free form properties schema type
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Oct 20, 2023
1 parent c3dfc28 commit 446eecb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
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 @@ -111,10 +111,9 @@ record AssetInputSchema(
String id,
@Schema(name = TYPE, example = EDC_ASSET_TYPE)
String type,
@Schema(requiredMode = REQUIRED, additionalProperties = Schema.AdditionalPropertiesValue.TRUE)
Map<String, Object> properties,
@Schema(additionalProperties = Schema.AdditionalPropertiesValue.TRUE)
Map<String, Object> privateProperties,
@Schema(requiredMode = REQUIRED)
ManagementApiSchema.FreeFormPropertiesSchema properties,
ManagementApiSchema.FreeFormPropertiesSchema privateProperties,
@Schema(requiredMode = REQUIRED)
ManagementApiSchema.DataAddressSchema dataAddress
) {
Expand Down Expand Up @@ -143,8 +142,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,9 +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,
ManagementApiSchema.FreeFormPropertiesSchema properties,
@Schema(additionalProperties = Schema.AdditionalPropertiesValue.TRUE)
Map<String, String> privateProperties,
ManagementApiSchema.FreeFormPropertiesSchema privateProperties,
List<ManagementApiSchema.CallbackAddressSchema> callbackAddresses) {

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

0 comments on commit 446eecb

Please sign in to comment.