pandera icon indicating copy to clipboard operation
pandera copied to clipboard

Import/export json-schemas and OpenAPI schemas

Open cosmicBboy opened this issue 3 years ago • 12 comments

Is your feature request related to a problem? Please describe. The problem statement here is the same as the one articulated in #420

Describe the solution you'd like Support the importing of json-schema and Open API data models with the following interface:

import pandera as pa

pandera_schema = pa.io.from_json_schema("path/to/schema.json")
json_schema = pandera_schema.json_schema()

pandera_schema = pa.io.from_open_api_schema("path/to/schema.json")
open_api_schema = pandera_schema.open_api_schema()

NOTE: This should probably be split into to issues, one for JSON schema, another for OpenAPI

For details on modules that would be involved in implementing this feature, see https://github.com/pandera-dev/pandera/issues/420#issuecomment-782389873

Describe alternatives you've considered

  • users implement their own schema importing functions.

Additional context See the discussion in #420

cosmicBboy avatar Feb 19 '21 22:02 cosmicBboy

Just a comment to upvote this feature request, it would make make Pandera super nice to use for https://github.com/spaAM-community/ancientmetagenomedir/tree/dev and https://github.com/SPAAM-community/AMDirT

maxibor avatar Jun 13 '22 09:06 maxibor

Another comment to upvote. I have JSON schema written for so many things -- would be great to reuse it

muppetjones avatar Apr 06 '23 14:04 muppetjones

Upvote from me too! We use JSON schema a lot for import/exporting our data.

hongha912 avatar Apr 25 '23 23:04 hongha912

Upvote from me as well. We want to use it across different tools which use JSON Schema

GuyAttia avatar Aug 17 '23 10:08 GuyAttia

Really interested in this feature :)

Upvote. Having this feature would be awesome. We have so many JSON Schemas... This would considerably simplify migrating all our validations to Pandera and, thus, make them much more efficient. 🤞

toclarity avatar Oct 13 '23 07:10 toclarity

Upvote. We need this feature to adapt all of our domain json schema to Panderas

victorrmclarity avatar Nov 16 '23 11:11 victorrmclarity

It would be really helpful to have this feature implemented 🙌

DaniSancas avatar Nov 16 '23 11:11 DaniSancas

Another upvote here. This will help a lot on our day to day work

silviacobo9 avatar Nov 16 '23 11:11 silviacobo9

+1

martingoldthen avatar Nov 16 '23 12:11 martingoldthen

yes please

adela-molina avatar Nov 16 '23 12:11 adela-molina

this could be really useful

jlrcolmenares avatar Nov 16 '23 13:11 jlrcolmenares