OpenAPI export
RAMOSE can export your API definition as an OpenAPI 3.0 YAML document. This lets you plug into the OpenAPI ecosystem: Swagger UI, client generators, API gateways, and so on.
From the CLI
Section titled “From the CLI”python -m ramose -s api.hf --openapi -o openapi.yamlWhen multiple spec files are loaded, use --api-base to select which one to export:
python -m ramose -s api_v1.hf api_v2.hf --openapi --api-base /api/v1 -o openapi.yamlFrom the web server
Section titled “From the web server”The OpenAPI spec is served automatically at <api_base>/openapi.yaml:
http://localhost:8080/api/v1/openapi.yamlAlso accessible as openapi.yml.
What gets exported
Section titled “What gets exported”The generated document includes:
- API metadata (
info.title,info.version,info.description,info.contact,info.license) - Server URLs derived from
#baseand#url - One path per operation, with parameters extracted from the URL template
- Parameter schemas inferred from
#<param>type declarations - Example values extracted from
#call - Response schemas with field types from
#field_type - Available output formats from
#formatdeclarations and built-incsv/json
RAMOSE-specific implementation details (endpoint, addon, method, preprocess, postprocess) are intentionally omitted from the output as they are not meaningful to API consumers.