Sign in

    moonbitstack/moonapi/openapi does not have a README file

    ApiInfo

    pub(all) struct ApiInfo {
    title : String
    api_version : String
    description : String
    terms_of_service : String
    contact : Contact?
    license : License?
    servers : Array[Server]
    }

    What the document says about the API itself — FastAPI's info block plus servers. An app carries one (App::describe sets it) so that every emission of the document, including the route enable_docs registers, agrees.

    ApiInfo::new

    fn ApiInfo::new() -> ApiInfo

    The defaults an app starts with.

    Contact

    pub(all) struct Contact {
    name : String
    url : String
    email : String
    }

    Build the OpenAPI / Swagger document for the app as a Json value, walking the registered routes once into paths → methods → operations. OpenAPI contact info (← FastAPI's contact): every field optional, emitted only when non-empty.

    License

    pub(all) struct License {
    name : String
    url : String
    }

    OpenAPI license info (← FastAPI's license_info): name required, url optional.

    Server

    pub(all) struct Server {
    url : String
    description : String
    }

    A servers entry (← FastAPI's servers): a base URL and an optional description.

    redoc_ui

    fn redoc_ui(spec_url? : String, title? : String) -> String

    A self-contained ReDoc page rendering the document served at spec_url — the second reading of the same spec FastAPI serves at /redoc, three-panel and built for reading rather than for trying calls out.

    swagger_ui

    fn swagger_ui(spec_url? : String, title? : String) -> String

    A self-contained Swagger UI page rendering the document served at spec_url.

    Source Files