Add better nullability support. #20

Merged
merged 4 commits into from Apr 28, 2013

Conversation

Projects
None yet
2 participants
@myronmarston
Contributor

myronmarston commented Apr 27, 2013

json-schema supports nullability through a type union.
However, it can be cumbersome to have to use type unions
everywhere. This commit adds better support for nullability:

  • Any property can declare its nullability with a simple
    nullable: true declaration.
  • Add a new scalars_nullable_by_default config setting.
Add better nullability support.
json-schema supports nullability through a type union.
However, it can be cumbersome to have to use type unions
everywhere. This commit adds better support for nullability:

* Any property can declare its nullability with a simple
  `nullable: true` declaration.
* Add a new `scalars_nullable_by_default` config setting.
@waltjones

This comment has been minimized.

Show comment Hide comment
@waltjones

waltjones Apr 27, 2013

Contributor

Looks good. #conditionally_make_nullable very nicely done.

Contributor

waltjones commented Apr 27, 2013

Looks good. #conditionally_make_nullable very nicely done.

myronmarston added some commits Apr 27, 2013

Remove configuration ordering dependency.
Previously, once you configured `endpoint_definition_files`, no other
config options would affect the endpoints even if they were meant to
because the endpoints were already loaded by that point.

This changes the endpoint loading so that it's lazy.
Fix a couple bugs in the nullable support.
- Don't change `type: null` to `type: [null]`.
- Don't blow up when there is an actual property named `type`.

myronmarston added a commit that referenced this pull request Apr 28, 2013

Merge pull request #20 from seomoz/nullable
Add better nullability support.

@myronmarston myronmarston merged commit 055f617 into master Apr 28, 2013

1 check passed

default The Travis build passed
Details

@myronmarston myronmarston deleted the nullable branch Apr 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment