unmbt/ciallo/openapi does not have a README file

    OpenApiError

    pub(all) suberror OpenApiError {
    DuplicateOperationId(operation_id~ : String, first_route~ : String, second_route~ : String)
    } derive(Eq,
    Debug
    )

    OpenApiDocument

    pub struct OpenApiDocument {
    info : OpenApiInfo
    operations : Array[OperationSpec]
    } derive(Eq,
    Debug
    )

    OpenApiDocument::to_json

    自动遍历展开 SchemaRef 聚拢至 #/components/schemas/,并附带 x-ciallo-eden 精确类型与流式扩展元数据

    OpenApiInfo

    pub(all) struct OpenApiInfo {
    title : String
    version : String
    description : String?
    } derive(Eq,
    Debug
    )

    OpenApiInfo::OpenApiInfo

    fn OpenApiInfo::OpenApiInfo(title~ : String, version~ : String, description? : String) -> OpenApiInfo

    OperationSpec

    pub(all) struct OperationSpec {
    operation_id : String?
    meth :
    Method

    path : String
    summary : String?
    description : String?
    tags : Array[String]
    deprecated : Bool
    params_schema :
    SchemaNode
    ?
    query_schema :
    SchemaNode
    ?
    body_schema :
    SchemaNode
    ?
    responses : Array[ResponseSpec]
    bearer_auth : Bool
    } derive(Eq,
    Debug
    )

    OperationSpec::OperationSpec

    fn OperationSpec::OperationSpec(meth~ :
    Method
    , path~ : String, operation_id? : String, summary? : String, description? : String, tags? : Array[String], deprecated? : Bool, params_schema? :
    SchemaNode
    , query_schema? :
    SchemaNode
    , body_schema? :
    SchemaNode
    , responses? : Array[ResponseSpec], bearer_auth? : Bool) -> OperationSpec

    ResponseKind

    pub(all) enum ResponseKind {
    Json(
    SchemaNode
    )
    Empty
    Sse(data_schema~ :
    SchemaNode
    , event_schemas~ : Map[String,
    SchemaNode
    ]?)
    Ndjson(item_schema~ :
    SchemaNode
    )
    Raw(content_type~ : String)
    } derive(Eq,
    Debug
    )

    代数响应载荷分类(同时驱动 OpenAPI 3.1、x-ciallo-eden MoonBit/TS 流式 SDK 与 v0.3 ciallo-mcp)

    ResponseSpec

    pub(all) struct ResponseSpec {
    status : Int
    description : String
    kind : ResponseKind
    } derive(Eq,
    Debug
    )

    ResponseSpec::ResponseSpec

    fn ResponseSpec::ResponseSpec(status~ : Int, description~ : String, kind? : ResponseKind) -> ResponseSpec

    build_document

    fn build_document(info : OpenApiInfo, operations : Array[OperationSpec]) -> OpenApiDocument raise OpenApiError

    scalar_html

    fn scalar_html(title~ : String, spec_url? : String, script_url? : String, custom_css? : String) -> String

    生成内置 Scalar 交互式 API 文档 HTML(支持内网离线替换 script_url 与 custom_css,注入属性严格 HTML 转义防 XSS)