UNPKG

@redocly/respect-core

Version:
13 lines 690 B
import { isPlainObject } from '@redocly/openapi-core'; // The isParameterWithoutIn and isParameterWithIn type guards are used to differentiate between // the two sides of onOffs in the parameter schema that is imported from the @redocly/openapi-core. export function isParameterWithoutIn(parameter) { return (isPlainObject(parameter) && 'name' in parameter && 'value' in parameter && !('in' in parameter)); } export function isParameterWithIn(parameter) { return (isPlainObject(parameter) && 'in' in parameter && typeof parameter.in === 'string' && ['header', 'query', 'path', 'cookie'].includes(parameter.in)); } //# sourceMappingURL=parse-parameters.js.map