ajevans99 / swift-json-schema

Generate JSON Schema documents from Swift
MIT License
8 stars 2 forks source link

Schema-based validation planned? #28

Open vdhamer opened 6 days ago

vdhamer commented 6 days ago

Hi Austin,

I am checking out your software to (at some point) create a formal schema.

I have (non-technical) users who need to supply relatively simple form-like input data in JSON format (as files accessible via a URL). For now without a tool to help them get the JSON exactly right (“here’s the template, fill in your own data, remove any fields you don’t need in the optional block, and be careful with your commas”).

At present the users have an informal description: level 2 JSON format.

With a schema, I could point them to an online checking tool. But feeding 2 separate files to a nerdly-looking checker is asking a bit too much. This implies that my app needs to validate the json as it comes in.

I can go find a schema validator. But do you have plans to extend in that direction? It would be nice to have a validator that is fully compatible with your schema generator. Or is that a moot point as long as you are subset of the official standard? And the validator covers at least that subset ;-)

[feel free to move this over to discussions, if needed]

ajevans99 commented 6 days ago

Hey @vdhamer,

I'm working on adding validation right now. I've started this in #22 and #23 but wasn't super happy with either approach.

Last night I spent some time rethinking how to represent the underlying Schema type and am making some progress. I don't have an exact timeline, but I'm actively working on it in my free time.

vdhamer commented 5 days ago

I'm working on adding validation right now. [,,] I don't have an exact timeline, but I'm actively working on it in my free time.

That’s great news. Your timeline is no problem for me: it will be a while before I make my (two) schema’s.

If you have any spec or discussion piece on validation that you want feedback on, let me know. I will check #22 and #23 for background info. I don’t have a JSON schema experience, but am into relational database schemas. Peter (in the Netherlands).