Skip to content

Commit

Permalink
docs: add free form properties schema type (#3555)
Browse files Browse the repository at this point in the history
* docs: add missing additional properties true on free-form properties attributes

* docs: add a free form properties schema type
  • Loading branch information
ndr-brt authored Oct 20, 2023
1 parent 2ea0ecc commit cba9558
Show file tree
Hide file tree
Showing 3 changed files with 13 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 @@ -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

0 comments on commit cba9558

Please sign in to comment.