loadOpenapiFromMemory
@the-codegen-project/cli • Docs
Home / loadOpenapiFromMemory
Function: loadOpenapiFromMemory()
function loadOpenapiFromMemory(specString): Promise<OpenAPIV3.Document | OpenAPIV2.Document | OpenAPIV3_1.Document>
Load and normalize an OpenAPI document already held in memory (as a raw
JSON/YAML string). Runs the exact same normalization as the local-file path
of loadOpenapiDocument — dereference followed by
reflectComponentSchemaNames — so in-memory callers (the platform's
generateInMemory, preview, and the playground) produce byte-identical
output to codegen generate on a file.
Parameters
| Parameter | Type |
|---|---|
specString | string |
Returns
Promise<OpenAPIV3.Document | OpenAPIV2.Document | OpenAPIV3_1.Document>
Defined in
src/codegen/inputs/openapi/parser.ts:106