checkSchemaVersionValidity method

Future<CheckSchemaVersionValidityResponse> checkSchemaVersionValidity({
  1. required DataFormat dataFormat,
  2. 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 AccessDeniedException. May throw InternalServiceException. May throw InvalidInputException.

Parameter dataFormat : The data format of the schema definition. Currently AVRO, JSON and PROTOBUF are supported.

Parameter schemaDefinition : The definition of the schema that has to be validated.

Implementation

Future<CheckSchemaVersionValidityResponse> checkSchemaVersionValidity({
  required DataFormat dataFormat,
  required String schemaDefinition,
}) async {
  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.value,
      'SchemaDefinition': schemaDefinition,
    },
  );

  return CheckSchemaVersionValidityResponse.fromJson(jsonResponse.body);
}