cookiecutter-spacy-fastapi icon indicating copy to clipboard operation
cookiecutter-spacy-fastapi copied to clipboard

Add annotations to return values

Open SirTelemak opened this issue 4 years ago • 2 comments

I think it's nice to have annotation for return values :) I'd liked to use something instead of List[dict] but it feels kinda confusing to use List[Dict[str, Union[str, list]]. I'd use pydantic model here or dataclass, but it's overkill here imo

SirTelemak avatar Nov 12 '20 15:11 SirTelemak

Sorry for the late review on this but thanks for taking an interest!

I'd prefer the more detailed type annotation rather than List[dict] but your point on just using Pydantic models is valid and I'd welcome that contribution if you'd like to make it.

Otherwise, I'll plan to update this repo with some best practice changes (like using Pydantic types all the way through) later this month or next month

kabirkhan avatar Jan 15 '21 20:01 kabirkhan

Sure, I'll make PR using Pydantic models. Can't say when, but hope I'll have time this month

SirTelemak avatar Jan 15 '21 21:01 SirTelemak