Skip to content
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

Support ForSchemaOption to call avro.Type.forSchema() #47

Merged
merged 1 commit into from
Mar 7, 2020

Conversation

Dieken
Copy link
Contributor

@Dieken Dieken commented Feb 21, 2020

So that we can use @ovotech/avro-logical-types with @kafkajs/confluent-schema-registry.

@Dieken
Copy link
Contributor Author

Dieken commented Mar 3, 2020

@tulios @erikengervall any comment?

@@ -28,9 +29,10 @@ export default class SchemaRegistry {
private api: SchemaRegistryAPIClient
public cache: Cache

constructor({ auth, clientId, host, retry }: SchemaRegistryAPIClientArgs) {
constructor({ auth, clientId, host, retry }: SchemaRegistryAPIClientArgs,
forSchemaOptions?: Partial<ForSchemaOptions>) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this second parameter be an object instead? That way it'd be more easily extendable if we wish to add more opts in the future :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we just add to SchemaRegistryAPIClientArgs?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn’t want to mix this into the APIClient options since it’s a completely separate thing.
That’s why I suggested adding a second argument, and to make it future-safe it’d be an object 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, just pushed again :-)

src/cache.ts Show resolved Hide resolved
@erikengervall
Copy link
Collaborator

@tulios @erikengervall any comment?

Sorry for the delay

I've reviewed the PR now 👍

@Dieken
Copy link
Contributor Author

Dieken commented Mar 6, 2020

@erikengervall @tulios please review again, thanks!

@erikengervall erikengervall self-requested a review March 6, 2020 10:53
src/api/index.ts Show resolved Hide resolved
@@ -28,9 +28,9 @@ export default class SchemaRegistry {
private api: SchemaRegistryAPIClient
public cache: Cache

constructor({ auth, clientId, host, retry }: SchemaRegistryAPIClientArgs) {
constructor({ auth, clientId, host, retry, forSchemaOptions }: SchemaRegistryAPIClientArgs) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed previously: introduce a second argument instead as an object.

So that we can use @ovotech/avro-logical-types with @kafkajs/confluent-schema-registry.
Copy link
Collaborator

@erikengervall erikengervall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@erikengervall erikengervall merged commit bb1286d into kafkajs:master Mar 7, 2020
@Dieken
Copy link
Contributor Author

Dieken commented Mar 7, 2020

could you bump the version in package.json? thanks!

@erikengervall
Copy link
Collaborator

could you bump the version in package.json? thanks!

Absolutely - it's on its way 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants