"producer_info_type_info": {
"description": "Information for an Information Type",
"type": "object",
- "required": ["info_job_data_schema"],
- "properties": {"info_job_data_schema": {
- "description": "Json schema for the job data",
- "type": "object"
- }}
+ "required": [
+ "info_job_data_schema",
+ "info_type_information"
+ ],
+ "properties": {
+ "info_type_information": {
+ "description": "Type specific information for the information type",
+ "type": "object"
+ },
+ "info_job_data_schema": {
+ "description": "Json schema for the job data",
+ "type": "object"
+ }
+ }
},
"producer_info_job_request": {
"description": "The body of the Information Producer callbacks for Information Job creation and deletion",
producer_info_type_info:
required:
- info_job_data_schema
+ - info_type_information
type: object
properties:
+ info_type_information:
+ type: object
+ description: Type specific information for the information type
info_job_data_schema:
type: object
description: Json schema for the job data
if (registrationInfo.jobDataSchema == null) {
return ErrorResponse.create("No schema provided", HttpStatus.BAD_REQUEST);
}
- InfoType newDefinition = new InfoType(infoTypeId, registrationInfo.jobDataSchema);
+ InfoType newDefinition =
+ new InfoType(infoTypeId, registrationInfo.jobDataSchema, registrationInfo.typeSpecificInformation);
this.infoTypes.put(newDefinition);
this.typeSubscriptions.notifyTypeRegistered(newDefinition);
return new ResponseEntity<>(previousDefinition == null ? HttpStatus.CREATED : HttpStatus.OK);
}
private ProducerInfoTypeInfo toInfoTypeInfo(InfoType t) {
- return new ProducerInfoTypeInfo(t.getJobDataSchema());
+ return new ProducerInfoTypeInfo(t.getJobDataSchema(), t.getTypeSpecificInfo());
}
private InfoProducers.InfoProducerRegistrationInfo toProducerRegistrationInfo(String infoProducerId,
@JsonProperty(value = "info_job_data_schema", required = true)
public Object jobDataSchema;
- public ProducerInfoTypeInfo(Object jobDataSchema) {
+ @Schema(
+ name = "info_type_information",
+ description = "Type specific information for the information type",
+ required = true)
+ @SerializedName("info_type_information")
+ @JsonProperty(value = "info_type_information", required = true)
+ public Object typeSpecificInformation;
+
+ public ProducerInfoTypeInfo(Object jobDataSchema, Object typeSpecificInformation) {
this.jobDataSchema = jobDataSchema;
+ this.typeSpecificInformation = typeSpecificInformation;
}
public ProducerInfoTypeInfo() {
@Getter
private final Object jobDataSchema;
- public InfoType(String id, Object jobDataSchema) {
+ @Getter
+ private final Object typeSpecificInfo;
+
+ public InfoType(String id, Object jobDataSchema, Object typeSpecificInfo) {
this.id = id;
this.jobDataSchema = jobDataSchema;
+ this.typeSpecificInfo = typeSpecificInfo;
}
}
ResponseEntity<String> resp = restClient().getForEntity(url).block();
ProducerInfoTypeInfo info = gson.fromJson(resp.getBody(), ProducerInfoTypeInfo.class);
assertThat(info.jobDataSchema).isNotNull();
+ assertThat(info.typeSpecificInformation).isNotNull();
}
@Test
ProducerInfoTypeInfo producerEiTypeRegistrationInfo(String typeId)
throws JsonMappingException, JsonProcessingException {
- return new ProducerInfoTypeInfo(jsonSchemaObject());
+ return new ProducerInfoTypeInfo(jsonSchemaObject(), typeSpecifcInfoObject());
}
ProducerRegistrationInfo producerEiRegistratioInfoRejecting(String typeId)
}
}
+ private Object typeSpecifcInfoObject() {
+ return jsonObject("{ \"propertyName\" : \"value\" }");
+ }
+
private Object jsonSchemaObject() {
// a json schema with one mandatory property named "string"
String schemaStr = "{" //