-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Merge standard sync schedule to standard sync #3472
Conversation
11dd1e5
to
a27e318
Compare
The e2e tests passed locally. |
@@ -65,7 +65,7 @@ public MigrationV0_14_1() { | |||
|
|||
@Override | |||
public String getVersion() { | |||
return "v0.11.1-alpha"; | |||
return "v0.14.1-alpha"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yikes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal since this is in test.
# Ideally schedule and manual should be a union, but java | ||
# codegen does not handle the union type properly. | ||
# When schedule is defined, manual should be false. | ||
schedule: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think something like that would be cleaner like:
schedule:
type: object
required:
- type
properties:
type: enum(manual, frequency, other_type)
frequency:
type: object
properties:
timeUnit:
type: string
enum:
- minutes
- hours
- days
- weeks
- months
units:
type: integer
other_type:
type: object
properties:
// blah
This way you don't polute StandardSync with manual
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally yes. The json-schema does support union with the oneOf
keyword. However, this keyword is not supported by the java code generator jsonschema2pojo
: joelittlejohn/jsonschema2pojo#392
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's why I had to do what Michel is proposing for the NotificationType
and OperatorType
fields:
airbyte/airbyte-api/src/main/openapi/config.yaml
Line 1381 in 9e3bfee
# the jsonschema2pojo does not seem to support it yet: https://github.com/joelittlejohn/jsonschema2pojo/issues/392 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I misunderstood what Michel was proposing. Basically we can make all those enum properties optional fields, and manually make sure only one of them exists on the object. That can work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the enum makes it a valid design (the best would be oneof ofcourse) instead of a hack
Amazing change :) Code is a lot cleaner now! Thanks for updating the different docs along the way |
What
How
StandardSyncSchema
toStandardSync
.manual
(required)schedule
StandardSyncSchema
ontoStandardSync
.Pre-merge Checklist
Recommended reading order
StandardSyncSchedule.yaml
.MigrationV0_24_0.java
.