Schemas
OasBoolean
A boolean schema: the OasSchema whose type is 'boolean'.
enums can limit its values. For example, a schema that accepts only true has [true].
Signature
import { OasBoolean } from '@skmtc/core'
class OasBoolean<Nullable extends boolean | undefined = boolean | undefined> extends OasBaseConstructor
constructor
constructor(fields?: BooleanFields<Nullable>, context?: ParseContextType)Properties
Object is part the 'schema' set which is used to define data types in an OpenAPI document.
Constant value 'boolean' useful for type narrowing and tagged unions.
A short summary of the boolean.
A description of the boolean.
Indicates whether value can be null.
Specification Extension fields
An example of the boolean.
Possible values the boolean can have
The default value of the boolean.
Whether the boolean is read-only
Whether the boolean is write-only
Whether the boolean is deprecated
The schema's not, kept as an OasUnknown under skmtc.config.json parse.not: unknown: the document says "not something", and core does not read what. undefined otherwise.
Methods
isRef
isRef(): this is OasRef<'schema'>Determines if this boolean is a reference object.
Always returns false since this is a concrete boolean instance, not a reference
isReadOnly
isReadOnly(): booleanWhether the value is readOnly: sent by the API only, never in a request.
isWriteOnly
isWriteOnly(): booleanWhether the value is writeOnly: sent in a request only, never by the API.
clone
clone(ref?: OasRef<'schema'>): OasBooleanA copy of this schema with what ref adds at its site applied: its nullable, readOnly, writeOnly and the keywords next to it (SiblingKeywords) that this type takes, a sibling's value winning. A value that does not fit this type is left out (the parser reports it). For OasRef.resolve(). This schema does not change, and the copy shares its child schemas.
traverse
traverse(path: SchemaPath): OasSchema | OasRef<'schema'>resolve
resolve(): OasBoolean<Nullable>Resolves this boolean object.
The boolean instance itself since it's already a concrete object, not a reference
resolveOnce
resolveOnce(): OasBoolean<Nullable>Resolves this boolean object one level.
The boolean instance itself since it's already a concrete object, not a reference
toJsonSchema
toJsonSchema(options?: ToJsonSchemaOptions): OpenAPIV3.NonArraySchemaObjectConverts this OAS boolean to an OpenAPI v3 JSON schema representation.
Conversion options (currently unused for boolean schemas)
OpenAPI v3 boolean schema object with type and all validation constraints