ring-swagger

marioaquino 2024-04-30T17:24:12.430319Z

Can anyone point me to a good way to validate a data shape against a Swagger json definition (the kind that swagger-ui provides a link to on any swagger API page)? I have only found this library: https://github.com/bjansen/swagger-schema-validator and it is pretty limited. I was hoping that I could use the ring-swagger library somehow to do that validation, but I didn’t see a way to validate that a data structure conforms to a Swagger API definition json file. My use case is validating data meant to be sent to a Swagger-wrapped API before making the call.

DenisMc 2024-04-30T21:33:42.356429Z

Depending on what precisely you’re looking to do https://github.com/oliyh/martian may help.

marioaquino 2024-04-30T21:37:03.933629Z

I’ll check it out. Thank you!!

marioaquino 2024-05-01T19:13:35.160649Z

@denis.mccarthy.kerry thanks for pointing me to the martian library. With it, I can generate plumatic schema representations of data types expressed in swagger json. That’s just what I needed!

👍 1