FastAPI-JSONAPI icon indicating copy to clipboard operation
FastAPI-JSONAPI copied to clipboard

Fix read custom model id field

Open mahenzon opened this issue 8 months ago • 1 comments

When specifying custom model id field using model_id_field_name there's an 500 internal server error when getting list of entities.

This PR fixes it using the provided models_storage.get_model_id_field_name

mahenzon avatar Mar 22 '25 16:03 mahenzon

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.63%. Comparing base (1556af3) to head (cc52512).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   91.44%   91.63%   +0.18%     
==========================================
  Files          44       44              
  Lines        2408     2414       +6     
  Branches      279      279              
==========================================
+ Hits         2202     2212      +10     
+ Misses        143      142       -1     
+ Partials       63       60       -3     
Flag Coverage Δ
unittests 91.63% <100.00%> (+0.18%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
fastapi_jsonapi/api/schemas.py 100.00% <100.00%> (ø)
fastapi_jsonapi/data_layers/base.py 93.84% <100.00%> (+0.19%) :arrow_up:
fastapi_jsonapi/data_layers/sqla/base_model.py 89.79% <100.00%> (ø)
fastapi_jsonapi/data_layers/sqla/orm.py 89.30% <ø> (ø)
fastapi_jsonapi/views/view_base.py 93.08% <100.00%> (+0.03%) :arrow_up:

... and 2 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Mar 22 '25 17:03 codecov[bot]