django-ninja icon indicating copy to clipboard operation
django-ninja copied to clipboard

Calculated fields are not visible in the schema

Open leiserfg opened this issue 2 years ago • 2 comments

The schema of the models uses validation instead of serialization and that causes the computed fields not to be shown (see https://docs.pydantic.dev/latest/api/json_schema/#pydantic.json_schema.JsonSchemaMode).

leiserfg avatar Nov 24 '23 21:11 leiserfg

@vitalik is there a known workaround for this, or a plan to address?

I can try to send a PR if you point me in the direction of where to fix

aurbano avatar Feb 19 '24 13:02 aurbano

@aurbano sure - go ahead

vitalik avatar Feb 19 '24 15:02 vitalik