Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add additonal OpenAPI metadata parameters to FastAPI class, shown on the automatic API docs UI #1812

Merged
merged 11 commits into from
Jul 29, 2021

Conversation

dkreeft
Copy link
Contributor

@dkreeft dkreeft commented Jul 30, 2020

As described in #843 that I needed and stumbled upon. This PR adds extra metadata parameters to the code and docs. So now you can specify contact and license information as well as terms of service.

I tried to keep the naming of the parameters in line with the specification, but unfortunately license is a Python built-in, so I went with license_info instead.

@dkreeft dkreeft marked this pull request as draft July 30, 2020 13:01
@codecov
Copy link

codecov bot commented Jul 30, 2020

Codecov Report

Merging #1812 (69e3b4b) into master (6c80e9a) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1812   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          401       401           
  Lines        10080     10090   +10     
=========================================
+ Hits         10080     10090   +10     
Impacted Files Coverage Δ
docs_src/metadata/tutorial001.py 100.00% <100.00%> (ø)
fastapi/applications.py 100.00% <100.00%> (ø)
fastapi/openapi/utils.py 100.00% <100.00%> (ø)
...ts/test_tutorial/test_metadata/test_tutorial001.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c80e9a...69e3b4b. Read the comment docs.

@dkreeft dkreeft marked this pull request as ready for review July 30, 2020 13:10
tests/test_tutorial/test_metadata/test_tutorial001.py Outdated Show resolved Hide resolved
fastapi/applications.py Outdated Show resolved Hide resolved
fastapi/openapi/utils.py Outdated Show resolved Hide resolved
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
@github-actions
Copy link
Contributor

📝 Docs preview for commit d977bce at: https://5f22d4d7fd565b6ce626f92a--fastapi.netlify.app

@dkreeft
Copy link
Contributor Author

dkreeft commented Aug 5, 2020

@Kludex do you mind approving this PR? Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2020

📝 Docs preview for commit 01144e1 at: https://5f2ae80bbc92b5c8d4e9f3cc--fastapi.netlify.app

@dkreeft
Copy link
Contributor Author

dkreeft commented Sep 10, 2020

@tiangolo any ETA for approving this request? In my team we are waiting for this change.

@tiangolo
Copy link
Member

Thanks @dkreeft! 🚀

I updated it a bit, updated the type annotations, order of arguments, and the docs.

Thanks for your contribution! ☕ 🍰

This will be available later today in FastAPI version 0.68.0 🔖🎉

@github-actions
Copy link
Contributor

📝 Docs preview for commit 69e3b4b at: https://6102c48f4a903a39c0f03146--fastapi.netlify.app

@tiangolo tiangolo changed the title Add extra metadata parameters to code and docs ✨ Add additonal OpenAPI metadata parameters to FastAPI class, shown on the automatic API docs UI Jul 29, 2021
@tiangolo tiangolo merged commit 6f45f43 into fastapi:master Jul 29, 2021
solomein-sv pushed a commit to solomein-sv/fastapi that referenced this pull request Jul 30, 2021
… on the automatic API docs UI (fastapi#1812)

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Co-authored-by: dkreeft <dkreeft@xccelerated.io>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants