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

203 non existing attribute is returned and causes float conversion error #311

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- add: flag to determine the deletion of registration when clearing the CB ([#267](https://github.com/RWTH-EBC/FiLiP/pull/267))
- fix: rework tutorials for pydantic v2 ([#259](https://github.com/RWTH-EBC/FiLiP/pull/259))
- fix: inconsistency of `entity_type` as required argument ([#188](https://github.com/RWTH-EBC/FiLiP/pull/188))
- fix: allow empty string in attribute value validation ([#311](https://github.com/RWTH-EBC/FiLiP/pull/311))

### v0.4.1
- fix: Session added as optional parameter to enable tls communication with clients ([#249](https://github.com/RWTH-EBC/FiLiP/pull/249))
Expand Down
4 changes: 2 additions & 2 deletions filip/models/ngsi_v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def validate_value_type(cls, value, info: ValidationInfo):
value_ = value.model_dump()
validate_escape_character_free(value_)

if value is not None:
if value not in (None, "", " "):
if type_ == DataType.TEXT:
if isinstance(value, list):
return [str(item) for item in value]
Expand Down Expand Up @@ -445,6 +445,7 @@ def validate_value_type(cls, value, info: ValidationInfo):
raise TypeError(
f"{type(value)} does not match " f"{DataType.OBJECT}"
)

# allows geojson as structured value
if type_ == DataType.GEOJSON:
if isinstance(
Expand All @@ -461,7 +462,6 @@ def validate_value_type(cls, value, info: ValidationInfo):
),
):
return value

if isinstance(value, dict):
_geo_json_type = value.get("type", None)
if _geo_json_type == "Point":
Expand Down