iya-sts
    Preparing search index...

    Captures one OpenAPI document's bytes and indexes its operations.

    Index
    served: string[] = ...

    The documents the service serves. admin, the unfiltered management document, is not one of them.

    • Adds a rewritten copy. The caller's schema object is not written.

      Parameters

      • ajv: any

        the compiler

      • schema: unknown

        the schema as captured

      • id: string

        the $id to assign

      • ids: Map<string, string>

        component name to $id

      Returns void

    • One Ajv instance. A new one per compile, so a second parse does not add the same $id twice.

      Returns any

      the compiler

    • Stores the document's JSON and an index of it. The index is built from a parse of that JSON, so it cannot alias the caller's object.

      Parameters

      • name: string

        which document this is

      • document: unknown

        the builder's object

      Returns ApiModel

      the captured model. text is JSON.stringify(document).

    • Compiles one schema. Failure is recorded on the model and returned. strict is off because an OpenAPI schema carries keywords draft 2020 does not (example, xml).

      Parameters

      • model: ApiModel

        the captured document

      • schemaName: string

        the schema to compile

      Returns { errors: string[]; validate: any }

      the validator, or errors

    • The captured bytes, unchanged.

      Parameters

      • model: ApiModel

        a model from capture()

      Returns string

      the string stored at capture

    • The index. text is already the bytes.

      Parameters

      • name: string

        the document name

      • text: string

        JSON.stringify of the builder object

      • document: any

        a parse of text

      Returns ApiModel

      the model

    • One path item. A method the document does not use is left alone. Any other key on the operation is vendor data and stays on the stored document either way, because the stored document is text.

      Parameters

      • docName: string

        the document name

      • path: string

        the path

      • item: any

        the path item

      • operations: ApiOperation[]

        the index being filled

      • inlineSchemas: ApiSchema[]

        inline response schemas

      • gaps: ApiGap[]

        the gap list

      Returns void

    • Records one compile failure, once per schema name.

      Parameters

      • model: ApiModel

        the captured document

      • name: string

        the schema

      • message: string

        Ajv's message

      Returns void

    • One operation.

      Parameters

      • docName: string

        the document name

      • path: string

        the path

      • method: string

        the HTTP method, lower case

      • source: any

        the operation object

      • inlineSchemas: ApiSchema[]

        inline response schemas

      • gaps: ApiGap[]

        the gap list

      Returns ApiOperation

      the index row

    • Checks one value against a component schema or an inline schema. Every attribute the schema marks required stays required: unlike the directory, an API schema is a contract the document already states.

      Parameters

      • model: ApiModel

        a captured document

      • schemaName: string

        a component name or an inline schema name

      • value: unknown

        the candidate

      Returns { errors: string[]; ok: boolean }

      whether it matches

    • The responses. A status with no schema is a gap. The schema is stored as the document wrote it, $ref included.

      Parameters

      • docName: string

        the document name

      • operationId: string

        the operation's id, or method and path

      • source: any

        the operation object

      • inlineSchemas: ApiSchema[]

        inline schemas being collected

      • gaps: ApiGap[]

        the gap list

      Returns ApiResponse[]

      one row per status

    • A copy of schema whose local component refs point at $ids.

      Parameters

      • schema: unknown

        the schema as captured

      • ids: Map<string, string>

        component name to $id

      Returns unknown

      the copy

    • The recursive copy rewrite() logs once around.

      Parameters

      • schema: unknown

        one node

      • ids: Map<string, string>

        component name to $id

      Returns unknown

      the copy

    • The $id Ajv will know this component by. An $id the schema already carries wins.

      Parameters

      • name: string

        the component name

      • schema: unknown

        the schema

      Returns string

      the id

    • Schema objects on one response. A content type with no schema does not count.

      Parameters

      • response: any

        one status's response object

      Returns unknown[]

      the schemas, in content-type order, then a bare schema