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

195 migrate to pydantic v2 #199

Merged
merged 50 commits into from
Nov 29, 2023
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b01fe7c
chore: change AnyMqttUrl
djs0109 Jul 13, 2023
7a4a3fc
chore: pydantic migration based on scripts
djs0109 Jul 13, 2023
720888c
chore: migration of QueryString
djs0109 Jul 13, 2023
330c816
chore: added some migration to tests
tstorek Jul 14, 2023
ff9b17a
chore: fixed some more issues
tstorek Jul 14, 2023
2d87ca0
chore: fixed open TODO[pydantic]
tstorek Jul 17, 2023
6e127d7
chore: fixed some deprecations
tstorek Jul 17, 2023
c1a3235
fix: replace json() with model_dump_json()
djs0109 Jul 17, 2023
4b43c09
chore: migrate function calls in test_units
djs0109 Jul 18, 2023
cd9693d
fix: pydantic-V2 regex validation
djs0109 Jul 21, 2023
ec15855
fix: log level in env template must be uppercase
djs0109 Jul 24, 2023
878e4b6
fix: IOT_JSON should not exist in .env
djs0109 Jul 24, 2023
bc6edc2
chore: further migration
djs0109 Jul 24, 2023
54361fd
chore: rename filip.types
djs0109 Jul 24, 2023
78eec86
chore: update signature of post validator
djs0109 Jul 28, 2023
b43d3fb
chore: migration of TypeAdapter, Url, and some small things
djs0109 Jul 28, 2023
112d66e
chore: add test for model_dump_json
djs0109 Jul 28, 2023
a477820
chore: make validation check optional
djs0109 Jul 31, 2023
3c2c302
chore: rework mqtt client test
djs0109 Jul 31, 2023
3b77341
chore: migration changes for Url
djs0109 Jul 31, 2023
7236a42
chore: migration changes for Url
djs0109 Jul 31, 2023
9d98684
chore: small fix
djs0109 Jul 31, 2023
e00076d
fix: model serializer should only be set once in the lowest level
djs0109 Aug 28, 2023
d9b7544
chore: add test for QueryString/Statement serialization
djs0109 Aug 28, 2023
b29b549
chore: tests rework
djs0109 Aug 28, 2023
53d154e
fix: update gitlab workflow of pages
djs0109 Sep 1, 2023
c7e4c23
fix: settings model
djs0109 Sep 1, 2023
fc74a24
fix: test environments
djs0109 Sep 1, 2023
27e143c
chore: ignore extra env variables in test_config
djs0109 Sep 4, 2023
756a370
chore: replace gh pages template with gl
djs0109 Sep 4, 2023
5e5aca8
chore: overwrite PYTHON_PACKAGE_NAME in gitlab workflow
djs0109 Sep 4, 2023
fa0cae6
test CI
djs0109 Sep 5, 2023
181cee3
test CI_PAGES_URL
djs0109 Sep 5, 2023
85d8e98
test CI_PAGES_URL
djs0109 Sep 5, 2023
167c894
test CI_PAGES_URL
djs0109 Sep 5, 2023
59697ab
test CI
djs0109 Sep 28, 2023
9769e94
chore: update deprecated functions
djs0109 Sep 29, 2023
165dac1
Merge remote-tracking branch 'origin/195-Migrate-to-pydantic-v2' into…
djs0109 Sep 29, 2023
96a9796
chore: update change log
djs0109 Sep 29, 2023
1e8a1c9
chore: revision after review
djs0109 Oct 30, 2023
9f34c9b
chore: revision after review
djs0109 Oct 30, 2023
0b271de
chore: revision after review
djs0109 Oct 31, 2023
af583fb
chore: use new syntax for HTTP model
djs0109 Nov 16, 2023
70ab616
chore: move model_config to the top of each class
djs0109 Nov 16, 2023
6525921
fix: github pages
djs0109 Nov 24, 2023
13537d0
chore: add hints for pydantic v1 users
djs0109 Nov 27, 2023
da5bbd1
chore: change back to gitlab pages
djs0109 Nov 27, 2023
b881bf1
chore: use AnyMqttUrl in TestMQTTClient
djs0109 Nov 28, 2023
01d1848
chore: update the usage of network types
djs0109 Nov 29, 2023
b340730
chore: exclude python 3.12 in CI
djs0109 Nov 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions filip/models/ngsi_v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@
class Http(BaseModel):
"""
Model for notification and registrations sent or retrieved via HTTP
"""
url: Union[AnyHttpUrl, str] = Field(
description="URL referencing the service to be invoked when a "
"notification is generated. An NGSIv2 compliant server "
"must support the http URL schema. Other schemas could "
"also be supported."
)

@field_validator('url')
@classmethod
def check_url(cls, value):
return validate_http_url(url=value)
url: It references the service to be invoked when a notification is
generated. An NGSIv2 compliant server must support the http URL
schema. Other schemas could also be supported.
"""
url: AnyHttpUrl
djs0109 marked this conversation as resolved.
Show resolved Hide resolved


class EntityPattern(BaseModel):
Expand Down