-
-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1184 from pdrvsky/fix/metadata-request-nullable-a…
…rray Change sent metadata topic array to be nullable (versions 1, 2 and 3)
- Loading branch information
Showing
3 changed files
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
const requestV0 = require('../v0/request') | ||
const Encoder = require('../../../encoder') | ||
const { Metadata: apiKey } = require('../../apiKeys') | ||
|
||
/** | ||
* Metadata Request (Version: 1) => [topics] | ||
* topics => STRING | ||
*/ | ||
|
||
module.exports = ({ topics }) => Object.assign(requestV0({ topics }), { apiVersion: 1 }) | ||
module.exports = ({ topics }) => ({ | ||
apiKey, | ||
apiVersion: 1, | ||
apiName: 'Metadata', | ||
encode: async () => { | ||
return new Encoder().writeNullableArray(topics) | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
const requestV0 = require('../v0/request') | ||
const requestV1 = require('../v1/request') | ||
|
||
/** | ||
* Metadata Request (Version: 2) => [topics] | ||
* topics => STRING | ||
*/ | ||
|
||
module.exports = ({ topics }) => Object.assign(requestV0({ topics }), { apiVersion: 2 }) | ||
module.exports = ({ topics }) => Object.assign(requestV1({ topics }), { apiVersion: 2 }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
const requestV0 = require('../v0/request') | ||
const requestV1 = require('../v1/request') | ||
|
||
/** | ||
* Metadata Request (Version: 3) => [topics] | ||
* topics => STRING | ||
*/ | ||
|
||
module.exports = ({ topics }) => Object.assign(requestV0({ topics }), { apiVersion: 3 }) | ||
module.exports = ({ topics }) => Object.assign(requestV1({ topics }), { apiVersion: 3 }) |