diff --git a/src/typegate/engine/src/py_validation.rs b/src/typegate/engine/src/py_validation.rs index 107645aeb..8a40cdf6b 100644 --- a/src/typegate/engine/src/py_validation.rs +++ b/src/typegate/engine/src/py_validation.rs @@ -18,7 +18,11 @@ fn read_file(path: &str) -> Result { #[deno_core::op2(fast)] pub fn op_validate(#[string] input: String) -> Result<()> { - let python_source = read_file(&input)?; - ast::Suite::parse(&python_source, "")?; + if let Some(file_name) = input.split(".").last() { + if file_name == "py" { + let python_source = read_file(&input)?; + ast::Suite::parse(&python_source, "")?; + } + } Ok(()) }