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

Add required option to field definitions #55

Closed
wants to merge 2 commits into from
Closed

Conversation

leplatrem
Copy link
Contributor

Allows to specify optional fields in definition.

I opend this PR, just to make sure you're ok with the required keyword at field level.

"fields": [{"name": "age", "type": "int", "required": False}]

If we switch to JSON schema #53, we'll move to global required attributes with list of field names, at definition level.

"fields": [{"name": "firstname", "type": "string"}, {"name": "age", "type": "int"}],
"required": ["name"],

The latter is slightly more complicated in client-side form generation...

@almet
Copy link
Member

almet commented Jun 6, 2013

I prefer the former, but JSON Schema is probably a good idea, since they already define the format, so complying with their APIs is IMO the way to go, nope?

@leplatrem
Copy link
Contributor Author

Ok then.

We keep the former.

And think again about this once we implement #53.

You can merge if you like then.

leplatrem added a commit that referenced this pull request Jun 12, 2013
Add required option to field definitions (ref #55)
@leplatrem leplatrem closed this Jun 12, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants