checkSchemaVersionValidity method
Future<CheckSchemaVersionValidityResponse>
checkSchemaVersionValidity({
- required DataFormat dataFormat,
- required String schemaDefinition,
Validates the supplied schema. This call has no side effects, it simply
validates using the supplied schema using DataFormat
as the
format. Since it does not take a schema set name, no compatibility checks
are performed.
May throw InvalidInputException. May throw AccessDeniedException. May throw InternalServiceException.
Parameter dataFormat
:
The data format of the schema definition. Currently only AVRO
is supported.
Parameter schemaDefinition
:
The definition of the schema that has to be validated.
Implementation
Future<CheckSchemaVersionValidityResponse> checkSchemaVersionValidity({
required DataFormat dataFormat,
required String schemaDefinition,
}) async {
ArgumentError.checkNotNull(dataFormat, 'dataFormat');
ArgumentError.checkNotNull(schemaDefinition, 'schemaDefinition');
_s.validateStringLength(
'schemaDefinition',
schemaDefinition,
1,
170000,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSGlue.CheckSchemaVersionValidity'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DataFormat': dataFormat.toValue(),
'SchemaDefinition': schemaDefinition,
},
);
return CheckSchemaVersionValidityResponse.fromJson(jsonResponse.body);
}