Skip to content

resolveDjangoSerializers

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/libs/parser-core/src/techdocs/cross-file-routes.ts

Fill in a DRF ModelSerializer's fields from the model it names.

class OutputSerializer(ModelSerializer): class Meta: model = BaseUser; fields = ("id", …) describes a real response shape, but the field TYPES live in another file. This runs once over the whole parse, where both halves are available.

A serializer whose model is not in the parse keeps no fields and therefore never becomes a component — better than a component with invented types. Returns how many were resolved.

Signature

ts
function resolveDjangoSerializers(entities: Entity[]): number

Parameters

NameType
entitiesEntity[]

Returns: number

Was this page helpful?

Download as PDF