You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "dao-jun (via GitHub)" <gi...@apache.org> on 2023/10/21 13:42:46 UTC
[PR] [feat][schema] Introduce BooleanSchema [pulsar-client-go]
dao-jun opened a new pull request, #1108:
URL: https://github.com/apache/pulsar-client-go/pull/1108
Fixes https://github.com/apache/pulsar-client-go/issues/1103
### Motivation
Introduce `BooleanSchema`
### Modifications
Add `BooleanSchema`
### Verifying this change
- [x] Make sure that the change passes the CI checks.
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
*(or)*
This change is already covered by existing tests, such as *(please describe tests)*.
*(or)*
This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end deployment with large payloads (10MB)*
- *Extended integration test for recovery after broker failure*
### Does this pull request potentially affect one of the following parts:
*If `yes` was chosen, please highlight the changes*
- Dependencies (does it add or upgrade a dependency): (no)
- The public API: (no)
- The schema: (yes)
- The default values of configurations: (no)
- The wire protocol: (no)
### Documentation
- Does this pull request introduce a new feature? (yes)
- If yes, how is the feature documented? (GoDocs)
- If a feature is not applicable for documentation, explain why?
- If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][schema] Introduce BooleanSchema [pulsar-client-go]
Posted by "dao-jun (via GitHub)" <gi...@apache.org>.
dao-jun commented on code in PR #1108:
URL: https://github.com/apache/pulsar-client-go/pull/1108#discussion_r1372612685
##########
pulsar/schema.go:
##########
@@ -178,7 +180,7 @@ func (js *JSONSchema) Decode(data []byte, v interface{}) error {
}
func (js *JSONSchema) Validate(message []byte) error {
- return js.Decode(message, nil)
+ return nil
Review Comment:
`Schema.Validate` method has never been called elsewhere before, but in actually, these methods will panic once they are called.
The second param cannot be nil.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][schema] Introduce BooleanSchema [pulsar-client-go]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #1108:
URL: https://github.com/apache/pulsar-client-go/pull/1108#discussion_r1372509152
##########
pulsar/schema.go:
##########
@@ -178,7 +180,7 @@ func (js *JSONSchema) Decode(data []byte, v interface{}) error {
}
func (js *JSONSchema) Validate(message []byte) error {
- return js.Decode(message, nil)
+ return nil
Review Comment:
why do we need these changes?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org