Skip to content

Commit

Permalink
Add flag to disable schema validate during process
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarros committed Aug 4, 2024
1 parent 1e89288 commit d0a820f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions backend/infrahub/core/schema_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,10 @@ def load_schema(self, schema: SchemaRoot) -> None:
new_item.update(node_extension)
self.set(name=node_extension.kind, schema=new_item)

def process(self) -> None:
def process(self, validate_schema: bool = True) -> None:
self.process_pre_validation()
self.process_validate()
if validate_schema:
self.process_validate()
self.process_post_validation()

def process_pre_validation(self) -> None:
Expand Down Expand Up @@ -2160,6 +2161,7 @@ async def load_schema_from_db(
schema: Optional[SchemaBranch] = None,
schema_diff: Optional[SchemaBranchDiff] = None,
at: Optional[Timestamp] = None,
validate_schema: bool = True,
) -> SchemaBranch:
"""Query all the node of type NodeSchema and GenericSchema from the database and convert them to their respective type.
Expand Down Expand Up @@ -2227,7 +2229,7 @@ async def load_schema_from_db(
schema=await self.convert_node_schema_to_schema(schema_node=schema_node, db=db),
)

schema.process()
schema.process(validate_schema=validate_schema)

return schema

Expand Down

0 comments on commit d0a820f

Please sign in to comment.