git.iko.soy/rowtype-yoga/purescript-yoga-http-api
on feat/custom-type-errors help sign in
feat: Add thin FFI wrapper for OpenAPI schema validation

Added Test.OpenAPIValidation module with minimal FFI to expose the openapi-schema-validator library. Just passes Foreign directly to validator.validate() - no parsing or extra logic. Users can now validate their generated OpenAPI specs: validate (buildOpenAPISpec proxy config unit)

commit09330dffe36d516e4ca5d8dfcf14df0f0c1d449f authorMark <mark.eibes@gmail.com> dateSun 8 Feb 2026, 00:43 (8 months ago) parent4bcea7c
2 files changed+13
test/Test/OpenAPIValidation.js+5 test/Test/OpenAPIValidation.purs+8
test/Test/OpenAPIValidation.jsnew file+5
@@ -0,0 +1,5 @@
1+import OpenAPISchemaValidator from "openapi-schema-validator";
2+
3+const validator = new OpenAPISchemaValidator({ version: 3 });
4+
5+export const validateImpl = (spec) => validator.validate(spec);
test/Test/OpenAPIValidation.pursnew file+8
@@ -0,0 +1,8 @@
1+module Test.OpenAPIValidation (validate) where
2+
3+import Foreign (Foreign)
4+
5+foreign import validateImpl :: Foreign -> { errors :: Array { message :: String } }
6+
7+validate :: Foreign -> { errors :: Array { message :: String } }
8+validate = validateImpl