schema-components - v3.7.0
    Preparing search index...

    Interface ApiOperationProps<Doc, Path, Method, ContentType, ResponseStatus, ResponseContentType>

    Props accepted by ApiOperation.

    interface ApiOperationProps<
        Doc = unknown,
        Path extends PathKeysOf<Doc> = PathKeysOf<Doc>,
        Method extends MethodKeysOf<Doc, Path> = MethodKeysOf<Doc, Path>,
        ContentType extends
            RequestContentTypesOf<Doc, Path, Method> = RequestContentTypesOf<
            Doc,
            Path,
            Method,
        >,
        ResponseStatus extends
            StatusKeysOf<Doc, Path, Method> = StatusKeysOf<Doc, Path, Method>,
        ResponseContentType extends
            ResponseContentTypesOf<Doc, Path, Method, ResponseStatus> = ResponseContentTypesOf<
            Doc,
            Path,
            Method,
            ResponseStatus,
        >,
    > {
        onDiagnostic?: DiagnosticSink;
        strict?: boolean;
        schema: Doc;
        path: Path;
        method: Method;
        requestBodyValue?: OpenAPIRequestBodyType<Doc, Path, Method, ContentType>;
        onRequestBodyChange?: (
            value: OpenAPIRequestBodyType<Doc, Path, Method, ContentType>,
        ) => void;
        responseValue?: OpenAPIResponseType<
            Doc,
            Path,
            Method,
            ResponseStatus,
            ResponseContentType,
        >;
        meta?: SchemaMeta;
        requestBodyContentType?: ContentType;
        responseStatus?: ResponseStatus;
        responseContentType?: ResponseContentType;
        requestBodyFields?: Doc extends Record<string, unknown>
            ? InferRequestBodyFields<Doc, Path, Method, ContentType>
            : Record<string, FieldOverride>;
        widgets?: WidgetMap;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    onDiagnostic?: DiagnosticSink
    strict?: boolean
    schema: Doc
    path: Path
    method: Method

    Current request body value. Inferred from the operation's request body schema via OpenAPIRequestBodyType so a typed schema argument drives the rendered value's shape.

    onRequestBodyChange?: (
        value: OpenAPIRequestBodyType<Doc, Path, Method, ContentType>,
    ) => void

    Called when the request body value changes. Parameter type mirrors ApiOperationProps.requestBodyValue.

    responseValue?: OpenAPIResponseType<
        Doc,
        Path,
        Method,
        ResponseStatus,
        ResponseContentType,
    >

    Current response value. Inferred via OpenAPIResponseType from the operation's response schema for the supplied responseStatus (defaulting to the union of declared statuses) and responseContentType (defaulting to the union of declared media types). The same value is rendered against every response card the component emits.

    meta?: SchemaMeta
    requestBodyContentType?: ContentType

    Media type whose request body schema drives requestBodyFields inference. Defaults to the union of declared content types so callers can omit it; supply explicitly to narrow inference to a specific media type. Mirrors ApiRequestBodyProps.contentType so <ApiOperation> can target non-JSON request bodies with the same precision as <ApiRequestBody>.

    responseStatus?: ResponseStatus

    Status code whose response schema drives responseValue inference. Defaults to the union of declared statuses so callers can omit it; supply explicitly to narrow inference to a specific response (e.g. "200").

    responseContentType?: ResponseContentType

    Media type whose response schema drives responseValue inference. Defaults to the union of declared content types so callers can omit it; supply explicitly to narrow inference to a specific media type.

    requestBodyFields?: Doc extends Record<string, unknown>
        ? InferRequestBodyFields<Doc, Path, Method, ContentType>
        : Record<string, FieldOverride>
    widgets?: WidgetMap

    Instance-scoped widgets.