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