awtkns / fastapi-crudrouter

A dynamic FastAPI router that automatically creates CRUD routes for your models
https://fastapi-crudrouter.awtkns.com
MIT License
1.34k stars 156 forks source link

Fix 404 on openapi spec #148

Open dimmaski opened 2 years ago

dimmaski commented 2 years ago

I'm running into issues when running the following command, against an API generated by fastapi-crudrouter (which is great btw 🥇 )

>> openapi-generator validate -i http://127.0.0.1:8000/openapi.json
Validating spec (http://127.0.0.1:8000/openapi.json)
Errors:
    - attribute paths.'/tag/{item_id}'(get).responses.404.detail is unexpected
    - attribute paths.'/project/{item_id}'(get).responses.404.detail is unexpected
    - attribute paths.'/tag/{item_id}'(delete).responses.404.detail is unexpected
    - attribute paths.'/project/{item_id}'(delete).responses.404.detail is unexpected
    - attribute paths.'/project/{item_id}'(put).responses.404.detail is unexpected
    - attribute paths.'/tag/{item_id}'(put).responses.404.detail is unexpected

[error] Spec has 6 errors.

I believe this PR resolves https://github.com/awtkns/fastapi-crudrouter/issues/105. Picking up on the great example left by @sondrelg at https://github.com/awtkns/fastapi-crudrouter/pull/104.

I believe this should also help resolve this PR https://github.com/awtkns/fastapi-crudrouter/pull/141.

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/flortz/fastapi-crudrouter/wjdX8HyZ9AsH8dj8cCqgaxWhnvpm
✅ Preview: https://fastapi-crudrouter-git-fork-dimmaski-105-404-openapi-fix-flortz.vercel.app

mitaka commented 2 years ago

I can confirm that this is an issue. Can you please fix the lint issue?

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
fastapi-crudrouter ✅ Ready (Inspect) Visit Preview May 31, 2022 at 7:42PM (UTC)
dimmaski commented 2 years ago

@mitaka, giving it a try :)

vercel[bot] commented 1 year ago

Someone is attempting to deploy a commit to a Personal Account owned by @awtkns on Vercel.

@awtkns first needs to authorize it.