Skip to content

Commit

Permalink
rename RunEvent and improve doc (apache#22)
Browse files Browse the repository at this point in the history
* rename RunEvent and improve doc
Signed-off-by: Julien Le Dem <[email protected]>
  • Loading branch information
julienledem authored Feb 17, 2021
1 parent 94af392 commit 45d4dcb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import io.openlineage.client.OpenLineage.JobFacets;
import io.openlineage.client.OpenLineage.Run;
import io.openlineage.client.OpenLineage.RunFacets;
import io.openlineage.client.OpenLineage.RunStateUpdate;
import io.openlineage.client.OpenLineage.RunEvent;

public class OpenLineageTest {

Expand All @@ -33,12 +33,12 @@ public void jsonSerialization() throws JsonProcessingException {
Job job = new Job(namespace, name, jobFacets);
List<Dataset> inputs = Arrays.asList();
List<Dataset> outputs = Arrays.asList();
OpenLineage.RunStateUpdate runStateUpdate = new OpenLineage.RunStateUpdate("START", "123", run, job, inputs, outputs, producer );
RunEvent runStateUpdate = new RunEvent("START", "123", run, job, inputs, outputs, producer );

ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationFeature.INDENT_OUTPUT, true);
String json = mapper.writeValueAsString(runStateUpdate);
RunStateUpdate read = mapper.readValue(json, RunStateUpdate.class);
RunEvent read = mapper.readValue(json, RunEvent.class);

assertEquals(producer,read.getProducer());
assertEquals(runId,read.getRun().getRunId());
Expand Down
8 changes: 4 additions & 4 deletions spec/OpenLineage.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"definitions": {
"RunStateUpdate": {
"RunEvent": {
"type": "object",
"properties": {
"eventType": {
Expand Down Expand Up @@ -168,10 +168,10 @@
"example": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client"
},
"_schemaURL": {
"description": "The URL to the corresponding version of the schema definition following a $ref URL Reference (see https://swagger.io/docs/specification/using-ref/)",
"description": "The JSON Pointer (https://tools.ietf.org/html/rfc6901) URL to the corresponding version of the schema definition for this facet",
"type": "string",
"format": "uri",
"example": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet"
"example": "https://raw.githubusercontent.com/OpenLineage/OpenLineage/0.0.1/spec/OpenLineage.json#/definitions/BaseFacet"
}
},
"required": [
Expand Down Expand Up @@ -420,7 +420,7 @@
},
"oneOf": [
{
"$ref": "#/definitions/RunStateUpdate"
"$ref": "#/definitions/RunEvent"
}
]
}
4 changes: 2 additions & 2 deletions spec/OpenLineage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ paths:
post:
summary: Send an event related to the state of a run
description: Updates a run state for a job.
operationId: postRunStateUpdate
operationId: postRunEvent
tags:
- OpenLineage
requestBody:
content:
application/json:
schema:
$ref: 'OpenLineage.json#/definitions/RunStateUpdate'
$ref: 'OpenLineage.json#/definitions/RunEvent'
responses:
'200':
description: OK
Expand Down

0 comments on commit 45d4dcb

Please sign in to comment.