[F] shouldInline
function shouldInline(program, type): boolean;Determines whether a type will be inlined in OpenAPI rather than defined as a schema and referenced.
All anonymous types (anonymous models, arrays, tuples, etc.) are inlined.
Template instantiations are inlined unless they have a friendly name.
A friendly name can be provided by the user using @friendlyName
decorator, or chosen by default in simple cases.
Anonymous declaration expressions (e.g. an inline enum { ... } or
scalar extends string used as a property type) have an empty name and are
inlined. A named declaration expression (e.g. model Inner { ... } used as a
property type) keeps its name and is hoisted into a schema like a regular
declaration.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
program | Program |
type | Type |
Returns
Section titled “Returns”boolean