UNPKG

@autorest/openapi-to-cadl

Version:

Autorest plugin to scaffold a Typespec definition from an OpenAPI document

33 lines 1.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isAnySchema = exports.isResponseSchema = exports.isDictionarySchema = exports.isSealedChoiceSchema = exports.isChoiceSchema = exports.isArraySchema = exports.isConstantSchema = void 0; const codemodel_1 = require("@autorest/codemodel"); function isConstantSchema(schema) { return schema.type === codemodel_1.SchemaType.Constant; } exports.isConstantSchema = isConstantSchema; function isArraySchema(schema) { return schema.type === codemodel_1.SchemaType.Array; } exports.isArraySchema = isArraySchema; function isChoiceSchema(schema) { return schema.type === codemodel_1.SchemaType.Choice; } exports.isChoiceSchema = isChoiceSchema; function isSealedChoiceSchema(schema) { return schema.type === codemodel_1.SchemaType.SealedChoice; } exports.isSealedChoiceSchema = isSealedChoiceSchema; function isDictionarySchema(schema) { return schema.type === codemodel_1.SchemaType.Dictionary; } exports.isDictionarySchema = isDictionarySchema; function isResponseSchema(response) { return response.schema !== undefined; } exports.isResponseSchema = isResponseSchema; function isAnySchema(schema) { return schema.type === codemodel_1.SchemaType.Any || schema.type === codemodel_1.SchemaType.AnyObject; } exports.isAnySchema = isAnySchema; //# sourceMappingURL=schemas.js.map