Skip to content

Commit

Permalink
fix: validation function did not return anything
Browse files Browse the repository at this point in the history
  • Loading branch information
fevral13 committed Jan 15, 2024
1 parent 51c0bcb commit db1011e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions openapi_om/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ def map_not_name(cls, values: DictAny) -> DictAny:
def validate(self):
if self.type == SchemaType.object:
self._validate_object()
return self

def _validate_object(self):
if self.properties is None:
Expand All @@ -362,6 +363,15 @@ def _validate_object(self):
schema_object=self,
)

def __and__(self, other: "Schema") -> "Schema":
return Schema(allOf=[self, other])

def __or__(self, other: "Schema") -> "Schema":
return Schema(anyOf=[self, other])

def __xor__(self, other: "Schema") -> "Schema":
return Schema(oneOf=[self, other])


class Parameter(BaseModelOptimizedRepr):
"""
Expand Down

0 comments on commit db1011e

Please sign in to comment.