File: //snap/google-cloud-cli/394/help/man/man1/gcloud_beta_pubsub_schemas_validate-message.1
.TH "GCLOUD_BETA_PUBSUB_SCHEMAS_VALIDATE\-MESSAGE" 1
.SH "NAME"
.HP
gcloud beta pubsub schemas validate\-message \- validate a message against a Pub/Sub schema
.SH "SYNOPSIS"
.HP
\f5gcloud beta pubsub schemas validate\-message\fR \fB\-\-message\fR=\fIMESSAGE\fR \fB\-\-message\-encoding\fR=\fIMESSAGE_ENCODING\fR (\fB\-\-schema\-name\fR=\fISCHEMA_NAME\fR\ |\ \fB\-\-type\fR=\fITYPE\fR\ (\fB\-\-definition\fR=\fIDEFINITION\fR\ |\ \fB\-\-definition\-file\fR=\fIPATH_TO_FILE\fR)) [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(BETA)\fR Validate a message against a Pub/Sub schema.
.SH "EXAMPLES"
To validate message against provided PROTOCOL_BUFFER schema, run:
.RS 2m
$ gcloud beta pubsub schemas validate\-message \-\-message="{\e"key\e": \e
\e"my\-key\e"}" \-\-message\-encoding=JSON \-\-definition="syntax = \e
'proto3'; message Message { optional string key = 1; \e
}" \-\-type=PROTOCOL_BUFFER
.RE
To validate an equivalent AVRO schema, run:
.RS 2m
$ gcloud beta pubsub schemas validate\-message \e
\-\-definition='{ "type": "record", "namespace": "my.ns", "name":
"KeyMsg", "fields": [ { "name": "key", "type": "string" } ] }' \e
\-\-type=AVRO
.RE
.SH "REQUIRED FLAGS"
.RS 2m
.TP 2m
\fB\-\-message\fR=\fIMESSAGE\fR
The message to validate against the schema.
.TP 2m
\fB\-\-message\-encoding\fR=\fIMESSAGE_ENCODING\fR
The encoding of the message. \fIMESSAGE_ENCODING\fR must be one of:
\fBbinary\fR, \fBjson\fR.
.TP 2m
Schema definition.
Exactly one of these must be specified:
.RS 2m
.TP 2m
\fB\-\-schema\-name\fR=\fISCHEMA_NAME\fR
Name or full path of an existing schema.
.TP 2m
\fB\-\-type\fR=\fITYPE\fR
Type of inline schema. \fITYPE\fR must be one of: \fBavro\fR,
\fBprotocol\-buffer\fR.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
Schema specification.
Exactly one of these must be specified:
.RS 2m
.TP 2m
\fB\-\-definition\fR=\fIDEFINITION\fR
Inline schema definition.
.TP 2m
\fB\-\-definition\-file\fR=\fIPATH_TO_FILE\fR
File containing schema definition. Use a full or relative path to a local file
containing the value of definition_file.
.RE
.RE
.RE
.sp
.SH "GCLOUD WIDE FLAGS"
These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.
Run \fB$ gcloud help\fR for details.
.SH "API REFERENCE"
This command uses the \fBpubsub/v1\fR API. The full documentation for this API
can be found at: https://cloud.google.com/pubsub/docs
.SH "NOTES"
This command is currently in beta and might change without notice. These
variants are also available:
.RS 2m
$ gcloud pubsub schemas validate\-message
.RE
.RS 2m
$ gcloud alpha pubsub schemas validate\-message
.RE