athena-framework / athena

An ecosystem of reusable, independent components
https://athenaframework.org
MIT License
211 stars 17 forks source link

validator - to_json_schema, from_json_schema #416

Closed dsisnero closed 4 months ago

dsisnero commented 4 months ago

when you have all of your validation constraints defined, is there a way to define a visitor or something so that you can output a json-schema for some of the easier constraints (min, max not nil, etc).

Blacksmoke16 commented 4 months ago

There is not. The validator component is intended to work on the object level, whereas JSON schema operates on the transport level, i.e. before the data is deserialized into an object. I'm not so sure it would make sense for the validator to know/care about JSON schema.

Can you share a bit more about your use case?

Blacksmoke16 commented 4 months ago

Going to close this for now. Happy to chat thru your use case in the Discord if you'd like.