@microsoft/kiota-serialization-json
Version:
Implementation of Kiota Serialization interfaces for JSON
22 lines • 965 B
JavaScript
/**
* -------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
* See License in the project root for license information.
* -------------------------------------------------------------------------------------------
*/
import { JsonSerializationWriter } from "./jsonSerializationWriter.js";
export class JsonSerializationWriterFactory {
getValidContentType() {
return "application/json";
}
getSerializationWriter(contentType) {
if (!contentType) {
throw new Error("content type cannot be undefined or empty");
}
else if (this.getValidContentType() !== contentType) {
throw new Error(`expected a ${this.getValidContentType()} content type`);
}
return new JsonSerializationWriter();
}
}
//# sourceMappingURL=jsonSerializationWriterFactory.js.map