Skip to content

Commit

Permalink
Fixed incorrect pydantic validation over the integration settings (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
yairsimantov20 authored Jun 5, 2024
1 parent 807191e commit e2a554d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

## 0.5.27 (2024-06-05)


### Bug Fixes

- Fixed incorrect pydantic validation over the integration settings


## 0.5.26 (2024-06-04)


Expand Down
11 changes: 5 additions & 6 deletions port_ocean/config/settings.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from typing import Any, Literal

from port_ocean.config.base import BaseOceanSettings, BaseOceanModel
from port_ocean.core.event_listener import EventListenerSettingsType
from port_ocean.utils.misc import get_integration_name
from pydantic import Extra, AnyHttpUrl, parse_obj_as
from pydantic.class_validators import root_validator
from pydantic.env_settings import InitSettingsSource, EnvSettingsSource, BaseSettings
from pydantic.fields import Field
from pydantic.main import BaseModel

from port_ocean.config.base import BaseOceanSettings, BaseOceanModel
from port_ocean.core.event_listener import EventListenerSettingsType
from port_ocean.utils.misc import get_integration_name

LogLevelType = Literal["ERROR", "WARNING", "INFO", "DEBUG", "CRITICAL"]


Expand Down Expand Up @@ -42,8 +41,8 @@ class PortSettings(BaseOceanModel, extra=Extra.allow):


class IntegrationSettings(BaseOceanModel, extra=Extra.allow):
identifier: str = Field(..., min_length=1)
type: str = Field(..., min_length=1)
identifier: str
type: str
config: dict[str, Any] | BaseModel = Field(default_factory=dict)

@root_validator(pre=True)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "port-ocean"
version = "0.5.26"
version = "0.5.27"
description = "Port Ocean is a CLI tool for managing your Port projects."
readme = "README.md"
homepage = "https://app.getport.io"
Expand Down

0 comments on commit e2a554d

Please sign in to comment.