tobyink / p5-json-schema

1 stars 4 forks source link

keyword "required" not used like documented #18

Open tobyink opened 3 years ago

tobyink commented 3 years ago

Migrated from rt.cpan.org #95923 (status was 'open')

Requestors:

Attachments:

From njfranck@cpan.org on 2014-05-24 13:35:11 :

According to the latest specification of JSON-Schema, one can require the existance of some keys like this:

{ "title": "Example Schema", "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, "age": { "description": "Age in years", "type": "integer", "minimum": 0 } }, "required": ["firstName", "lastName"] }

But this "required" is not supported in your module in this way. Your module does it like this:

.. "lastName": { "type": "string", "required": 1 } ..

Cf. http://json-schema.org/examples.html

Are you using an older version of the specification? Doesn't matter if it is older. But I just need to know what version is supported, so I can document it.

Thanks in advance

tobyink commented 3 years ago

From ruz@cpan.org (@ruz) on 2014-08-01 09:26:09 :

Hi,

I wrote a simple patch to enable support of "required" keyword. I'm not sure completely if it's correct in all situations, but this is a start.

Can you tell what should I do to get it merged? Do you see any problems?

-- Best regards, Ruslan.

tobyink commented 3 years ago

From perl@toby.ink on 2014-09-11 13:20:03 :

JSON::Schema supports an older version of the spec, circa 2012.

Given how much the spec has changed over time, I'm not willing to play catch-up. Instead I want to wait until the JSON Schema people give some kind of indication that the spec is stable. Ideally, by finally publishing it as an IETF RFC.

Once that happens, I'll rewrite JSON::Schema from scratch (but retain the current API for compatibility).

In the mean time, I'm happy for somebody else to have co-maint of JSON::Schema for small updates like this, provided they agree to the overall plan that the current implementation will eventually be scrapped.

If anybody wants to volunteer, let me know. Until then, I am marking this issue as stalled.

tobyink commented 3 years ago

From ruz@cpan.org (@ruz) on 2015-11-19 13:07:56 :

On Thu Sep 11 09:20:03 2014, TOBYINK wrote:

If anybody wants to volunteer, let me know. Until then, I am marking this issue as stalled.

I'm willing to volunteer (CPANID: RUZ) as otherwise my team will probably fork this module.

-- Best regards, Ruslan.