Skip to content
This repository has been archived by the owner on Mar 19, 2019. It is now read-only.

Allow empty "required" array #232

Closed
gibson042 opened this issue Apr 6, 2016 · 9 comments
Closed

Allow empty "required" array #232

gibson042 opened this issue Apr 6, 2016 · 9 comments

Comments

@gibson042
Copy link

Draft v4 specifies that a required array "MUST have at least one element", which makes it impossible to explicitly indicate that all properties are optional (and therefore also impossible to distinguish intentional optionality from accidental omission of required). Empty values ("required": []) should be permitted.

@erosb
Copy link

erosb commented Apr 6, 2016

+1

@YurySk
Copy link

YurySk commented Apr 6, 2016

I agree that this is an odd requirement. But also agree that V4 is best
left unchanged due to existing tooling (including my validator).

On April 6, 2016 13:01:57 Ivan Goncharov notifications@github.com wrote:

@gibson042 All OpenAPI tools that I saw so far used standard JSON Schema
validators.
By making this change you will break these tools, and I don't believe it's
a good tradeoff.

At the same time, your proposal is very reasonable can you submit it for
Draft5?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#232 (comment)

@gibson042
Copy link
Author

Absolutely. V4 is published and should be immutable; I'm proposing this change for the next version.

@YurySk
Copy link

YurySk commented Apr 6, 2016

+1

@Ixrec
Copy link

Ixrec commented Apr 6, 2016

👍 for doing this in V5.

@robbie-mac
Copy link

+1 and agree it should be for V5

@hernandos
Copy link

-1 require should only be written if any attribute is required. By default all items are optional, there is no a reason to write a empty array. The definition of the V4 is correct.

@erosb
Copy link

erosb commented Sep 30, 2016

This repository is deprecated. Current spec work is going on at
github.com/json-schema-org/json-schema-spec

2016-09-30 9:50 GMT+02:00 Hernando Saenz notifications@github.com:

-1 require should only be written if any attribute is required. By
default all items are optional, there is no a reason to write a empty
array. The definition of the V4 is correct.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#232 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAQrBucPjjGYR6ZdLSG99WTcED-YU6_sks5qvL9LgaJpZM4IBSID
.

Bence Erősme@github https://github.com/erosb

@handrews
Copy link

handrews commented Oct 7, 2016

@gibson042 since you've moved the conversation, could you please close this issue? There's no one left here with the necessary privileges to close issues opened by other people.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants