@autorest/openapi-to-typespec
Version:
Autorest plugin to scaffold a Typespec definition from an OpenAPI document
60 lines • 2.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isConstantSchema = isConstantSchema;
exports.isStringSchema = isStringSchema;
exports.isUriSchema = isUriSchema;
exports.isUuidSchema = isUuidSchema;
exports.isArraySchema = isArraySchema;
exports.isChoiceSchema = isChoiceSchema;
exports.isSealedChoiceSchema = isSealedChoiceSchema;
exports.isDictionarySchema = isDictionarySchema;
exports.isResponseSchema = isResponseSchema;
exports.isAnySchema = isAnySchema;
exports.isAnyObjectSchema = isAnyObjectSchema;
exports.isArmIdSchema = isArmIdSchema;
exports.isDurationSchema = isDurationSchema;
exports.isUnixTimeSchema = isUnixTimeSchema;
const codemodel_1 = require("@autorest/codemodel");
function isConstantSchema(schema) {
return schema.type === codemodel_1.SchemaType.Constant;
}
function isStringSchema(schema) {
return schema.type === codemodel_1.SchemaType.String;
}
function isUriSchema(schema) {
return schema.type === codemodel_1.SchemaType.Uri;
}
function isUuidSchema(schema) {
return schema.type === codemodel_1.SchemaType.Uuid;
}
function isArraySchema(schema) {
return schema.type === codemodel_1.SchemaType.Array;
}
function isChoiceSchema(schema) {
return schema.type === codemodel_1.SchemaType.Choice;
}
function isSealedChoiceSchema(schema) {
return schema.type === codemodel_1.SchemaType.SealedChoice;
}
function isDictionarySchema(schema) {
return schema.type === codemodel_1.SchemaType.Dictionary;
}
function isResponseSchema(response) {
return response.schema !== undefined;
}
function isAnySchema(schema) {
return schema.type === codemodel_1.SchemaType.Any;
}
function isAnyObjectSchema(schema) {
return schema.type === codemodel_1.SchemaType.AnyObject;
}
function isArmIdSchema(schema) {
return schema.type === codemodel_1.SchemaType.ArmId;
}
function isDurationSchema(schema) {
return schema.type === codemodel_1.SchemaType.Duration;
}
function isUnixTimeSchema(schema) {
return schema.type === codemodel_1.SchemaType.UnixTime;
}
//# sourceMappingURL=schemas.js.map