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

Simplify create_pydantic_model #892

Merged
merged 7 commits into from
Oct 19, 2023
Merged

Conversation

dantownsend
Copy link
Member

Simplifying create_pydantic_model for v1.

The main thing is all additional fields added to the JSON schema are namespaced under extra.

This makes things a lot easier to understand, and means we're less likely to clash with anything in JSON schema in the future.

dantownsend and others added 6 commits September 11, 2023 20:41
* support Postgres 16

* remove Postgres 10
I didn't like how it was overriding `format` on the JSON schema.

All of the custom values we add to the JSON schema are now namespaced under the `extra` key. It makes things much less confusing and more maintainable.
@dantownsend dantownsend added the enhancement New feature or request label Oct 19, 2023
@dantownsend dantownsend merged commit 285c8ca into v1 Oct 19, 2023
37 checks passed
dantownsend added a commit that referenced this pull request Oct 20, 2023
* pydantic v2 support (#866)

* pydantic v2 support

based off master...sinisaos:piccolo:pydanticV2_test by @sinisaos

* add more schema attributes for Piccolo Admin compatibility

* use newer fastapi in asgi template

* fix indentation in docstring

* update docs

* add docs for v1

* fixed typo in version number, `0.108` -> `0.118`

* fix link

* use `model_validate_json` instead of `parse_raw`

* fix deprecation warnings for `dict` method

* improve pydantic version specifier

* run tests on v1 branch

* bumped version

* fix banner link

* fix typo in link

* Simplify `create_pydantic_model` (#892)

* Merge pull request from GHSA-h7cm-mrvq-wcfr

Co-authored-by: skelmis <[email protected]>

* bumped version

* fix typo

* Support Postgres 16 (#886)

* support Postgres 16

* remove Postgres 10

* simplify `create_pydantic_model`

I didn't like how it was overriding `format` on the JSON schema.

All of the custom values we add to the JSON schema are now namespaced under the `extra` key. It makes things much less confusing and more maintainable.

* fix tests

---------

Co-authored-by: skelmis <[email protected]>

* bumped version

* update docs

---------

Co-authored-by: skelmis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant