27 Commits

Author SHA1 Message Date
Kazantcev Andrey 434d32b891 ⚡ Optimize regexp pattern in get_path_param_names (#1243) 2020-06-12 21:59:32 +02:00
Sebastián Ramírez 5984233223 🐛 Fix Enum handling with their own schema definitions (#1463)
* 🐛 Fix extra support for enum with its own schema

* ✅ Fix/update test for enum with its own schema

* 🐛 Fix type declarations

* 🔧 Update format and lint scripts to support locally installed Pydantic and Starlette

* 🐛 Add temporary type ignores while enum schemas are merged
2020-05-23 18:56:18 +02:00
voegtlel 0f152b4e97 🐛 Check already cloned fields in create_cloned_field to support recursive models (#1164)
* FIX: #894
Include recursion check for create_cloned_field.
Added test for recursive model.

* ♻️ Refactor and format create_cloned_field()

Co-authored-by: Lukas Voegtle <lukas.voegtle@sick.de>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-03-29 19:26:29 +02:00
Patrick McKenna afad59dfbb 🐛 Admit valid types for Pydantic fields as responses models (#1017) 2020-02-29 14:04:35 +01:00
Andy Smith 70bdade23b 🐛 Fix Pydantic field clone logic with validators (#899) 2020-02-04 04:03:51 +01:00
Sebastián Ramírez 75a07f24bf 🔒 Fix clone field implementation to handle sub-models in response_model (#889) 2020-01-18 18:03:51 +01:00
Ben Dayan 73260971b5 ✨ Add support for OpenAPI Callbacks (#722) 2019-12-11 17:58:00 +01:00
Sebastián Ramírez 83d04df8a6 🔊 Refactor logging (#781) 2019-12-09 20:02:44 +01:00
dmontagu ab2b86fe2c ✨ Add support for Pydantic v1 and above 🎉 (#646)
* Make compatible with pydantic v1

* Remove unused import

* Remove unused ignores

* Update pydantic version

* Fix minor formatting issue

* ⏪ Revert removing iterate_in_threadpool

* ✨ Add backwards compatibility with Pydantic 0.32.2

with deprecation warnings

* ✅ Update tests to not break when using Pydantic < 1.0.0

* 📝 Update docs for Pydantic version 1.0.0

* 📌 Update Pydantic range version to support from 0.32.2

* 🎨 Format test imports

* ✨ Add support for Pydantic < 1.2 for populate_validators

* ✨ Add backwards compatibility for Pydantic < 1.2.0 with required fields

* 📌 Relax requirement for Pydantic to < 2.0.0 🎉 🚀

* 💚 Update pragma coverage for older Pydantic versions
2019-11-27 20:32:02 +01:00
James Addison 4e50f53459 🐛 Fixing validator-caused incorrect output key order (#637) 2019-11-24 14:23:33 +01:00
dmontagu d8fe307d61 ✨ Add support for strings and __future__ type annotations (#451)
* Add support for strings and __future__ annotations

* Add comments indicating reason for string annotations

* Fix ignores (including removing some unused ignores)
2019-09-29 16:19:09 -05:00
dconathan 3025a368c6 ✨ Add support and tests for Pydantic dataclasses in response_model (#454) 2019-08-30 18:12:15 -05:00
James Kaplan 46a986cacf ⬆️ Upgrade Pydantic to 0.30 (#384)
* bump pydantic to 0.30

* 📌 Pin Pydantic to 0.30 as 0.31 hasn't been released
2019-07-12 18:56:25 -05:00
Sebastián Ramírez 687065509b 🏗️ Fix same function names in different modules with composite bodies (#347)
* 🏗️ Implement unique IDs for dynamic models

like those used for composite bodies and responses. IDs based on path (not only on function name, as it can be duplicated in a different module).

* ✅ Add tests for same function name and composite body

* ✅ Update OpenAPI in tests with new dynamic model ID generation
2019-06-28 19:35:16 +02:00
Sebastián Ramírez dcc1e1bcf8 ♻️ Refine internal type declarations and logic around them (#338) 2019-06-27 20:51:17 +02:00
Sebastián Ramírez aa84ac8e3e ✨ Implement support for Pydantic's ORM mode (#322)
* ✨ Implement support for Pydantic's ORM mode

* 🏗️ Re-structure/augment SQL tutorial source using ORM mode

* 📝 Update SQL docs with SQLAlchemy, ORM mode, relationships

* 🔥 Remove unused util in tutorial

* 📝 Add tutorials for simple dict bodies and responses

* 🔥 Remove old SQL tutorial

* ✅ Add/update tests for SQL tutorial

* ✅ Add tests for simple dicts (body and response)

* 🐛 Fix cloning field from original field
2019-06-20 11:31:32 +02:00
James Kaplan f0df79aa91 ⬆️ Upgrade Pydantic to 0.28 (#320) 2019-06-18 09:37:40 +02:00
Sebastián Ramírez 546d233dec ♻️ Update Pydantic usage, types, values, minor structure changes (#164) 2019-04-16 23:26:09 +04:00
Sebastián Ramírez 2bd775988f ✨ Add/refactor addditional responses, tests, docs 2019-04-05 13:54:00 +04:00
Mohammed 84a300ef84 Formatting according to guide 2019-03-22 22:54:48 +03:00
Mohammed aa0bca7bb2 Additional Responses implementation 2019-03-22 22:40:07 +03:00
Sebastián Ramírez 577c5a84db 🐛 Fix constrained bytes, from defaults in Pydantic
#2
2019-01-05 17:30:27 +04:00
Sebastián Ramírez 7da9625505 💚 Revert to flit install and re-format
As it has shown to be more reliable, and closer to final user environments
2018-12-18 22:36:04 +04:00
Sebastián Ramírez 00e2e544c7 ♻️ Re-format tutorials, files names and tests
for tutorial files
2018-12-18 21:59:06 +04:00
Sebastián Ramírez db3c270f8e ✨ Update requests with body, rename params 2018-12-08 11:55:36 +04:00
Sebastián Ramírez 0e19c24014 ✨ Update parameter names and order
fix mypy types, refactor, lint
2018-12-07 19:12:16 +04:00
Sebastián Ramírez b9d912c638 ♻️ Refactor, fix and update code 2018-12-06 20:24:50 +04:00