Skip to content

modelToSchema

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/libs/parser-core/src/openapi/model-schemas.ts

One model → one OpenAPI object schema. A field whose type names another model becomes a $ref, so a response carrying nested records stays navigable rather than collapsing to {type: object}.

Signature

ts
function modelToSchema(fields: FieldLike[], knownModels: Set<string>): Record<string, unknown>

Parameters

NameType
fieldsFieldLike[]
knownModelsSet<string>

Returns: Record<string, unknown>

Was this page helpful?

Download as PDF