oas2moon_codegen

    MoonBit SDK emitter for the oas2moon OpenAPI client generator.

    openapi
    codegen
    moonbit
    sdk
    Download zip
    Version
    0.1.0
    License
    MIT
    Last updated
    5 hours ago
    Downloads
    3

    Dependencies

    #oas2moon codegen

    MoonBit SDK emitter for oas2moon.

    The emitter consumes Canonical Client IR only and generates deterministic, compile-ready MoonBit client packages.

    ApiIr

    pub struct ApiIr {
    module_name : String
    title : String
    version : String
    servers : Array[String]
    auth_schemes : Array[AuthSchemeIr]
    models : Array[ModelIr]
    operations : Array[OperationIr]
    } derive(Eq,
    Debug
    )

    AuthSchemeIr

    pub struct AuthSchemeIr {
    name : String
    kind : String
    location : String?
    key_name : String?
    } derive(Eq,
    Debug
    )

    EnumMemberIr

    pub struct EnumMemberIr {
    name : String
    wire : String
    } derive(Eq,
    Debug
    )

    EnumModelIr

    pub struct EnumModelIr {
    name : String
    members : Array[EnumMemberIr]
    } derive(Eq,
    Debug
    )

    FieldIr

    pub struct FieldIr {
    name : String
    wire_name : String
    type_ref : TypeRef
    presence : String
    } derive(Eq,
    Debug
    )

    ModelIr

    pub enum ModelIr {
    EnumModel(EnumModelIr)
    StructModel(StructModelIr)
    } derive(Eq,
    Debug
    )

    OperationIr

    pub struct OperationIr {
    operation_id : String
    fn_name : String
    http_method : String
    path : String
    tags : Array[String]
    parameters : Array[ParameterIr]
    request_body : RequestBodyIr?
    body_name : String?
    success_responses : Array[ResponseIr]
    error_responses : Array[ResponseIr]
    response_strategy : ResponseStrategy
    security : Array[String]
    source_pointer : String
    } derive(Eq,
    Debug
    )

    ParamLocation

    pub enum ParamLocation {
    PathLoc
    QueryLoc
    HeaderLoc
    } derive(Eq,
    Debug
    )

    ParameterIr

    pub struct ParameterIr {
    name : String
    wire_name : String
    location : ParamLocation
    type_ref : TypeRef
    required : Bool
    nullable : Bool
    presence : String
    } derive(Eq,
    Debug
    )

    RequestBodyIr

    pub struct RequestBodyIr {
    type_ref : TypeRef?
    required : Bool
    media_type : String?
    } derive(Eq,
    Debug
    )

    ResponseIr

    pub struct ResponseIr {
    status : Int
    type_ref : TypeRef?
    media_type : String?
    } derive(Eq,
    Debug
    )

    ResponseStrategy

    pub enum ResponseStrategy {
    SingleResult(TypeRef)
    UnitResult
    ResponseEnum(Array[ResponseVariant])
    NoContent
    UnsupportedMediaType(String)
    } derive(Eq,
    Debug
    )

    ResponseVariant

    pub struct ResponseVariant {
    status : Int
    type_ref : TypeRef
    } derive(Eq,
    Debug
    )

    StructModelIr

    pub struct StructModelIr {
    name : String
    fields : Array[FieldIr]
    additional_properties : Bool
    additional_properties_field : String?
    } derive(Eq,
    Debug
    )

    TypeRef

    pub struct TypeRef {
    kind : String
    name : String?
    item : TypeRef?
    } derive(Eq,
    Debug
    )

    parse_api

    fn parse_api(value : Json) -> ApiIr raise

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io