Schemas
OasInteger
An integer schema: the OasSchema whose type is 'integer'. A schema of type: number is an OasNumber.
- The parser keeps only the formats
int32andint64. For another one, such asuint32,formatisundefined. - In each OpenAPI version, an exclusive limit is in
maximumorminimum, andexclusiveMaximumorexclusiveMinimumistrue.
Signature
import { OasInteger } from '@skmtc/core'
class OasInteger<Nullable extends boolean | undefined = boolean | undefined> extends OasBaseConstructor
constructor
constructor(fields?: IntegerFields<Nullable>, context?: ParseContextType)Properties
Object is part the 'schema' set which is used to define data types in an OpenAPI document.
Constant value 'integer' useful for type narrowing and tagged unions.
A short summary of the integer.
A description of the integer.
Indicates whether value can be null.
The format of the integer.
An array of allowed values for the integer.
Specification Extension fields
An example of the integer.
The multiple of the integer.
The maximum value of the integer.
Whether the maximum value is exclusive.
The minimum value of the integer.
Whether the minimum value is exclusive.
The default value of the integer.
Whether the integer is read-only.
Whether the integer is write-only.
Whether the integer 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'>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'>): OasIntegerA 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(): OasInteger<Nullable>resolveOnce
resolveOnce(): OasInteger<Nullable>toJsonSchema
toJsonSchema(options?: ToJsonSchemaOptions): OpenAPIV3.NonArraySchemaObject