Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Schema support for schema.Dict #88

Merged
merged 1 commit into from
Feb 1, 2017
Merged

Conversation

smyrman
Copy link
Collaborator

@smyrman smyrman commented Feb 1, 2017

This commits resolves #33 by adding JSON Schema support for schema.Dict.
The support limits KeysValidator instances to be a schema.String
instance or nil as explained in the README.

README.md Outdated

### Custom FieldValidators

For a custom `FieldValidator` to support encoding to JSON Schema, it must implement the `jsonschema.Builder` interface:
For a custom `FieldValidator` to support encoding to JSON Schema, it must implement the `jsonschema.Builder` interface:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opps extra space...

@smyrman smyrman force-pushed the jsonschema-dict branch 2 times, most recently from cf26f74 to 912d4a7 Compare February 1, 2017 12:37
}`),
},
{
name: `KeyValidator=String{Regex:"re"},ValuesValidator=Integer{}"`,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be Regexp in name

Validator: &schema.Dict{
KeysValidator: &schema.String{
Regexp: "tch",
Allowed: []string{"match1", "match2"},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should not have passed...

@smyrman
Copy link
Collaborator Author

smyrman commented Feb 1, 2017

Let's wait for #90 to be merged first and then rebase.

This commits resolves rs#33 by adding JSON Schema support for schema.Dict.
The support limits KeysValidator instances to be a schema.String
instance or nil as explained in the README.
@rs rs merged commit 2379ca1 into rs:master Feb 1, 2017
@smyrman smyrman mentioned this pull request Feb 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[jsonschema] Support for schema.Dict
2 participants