-
Notifications
You must be signed in to change notification settings - Fork 34
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
Amanda v0.4.0 #35
Merged
Amanda v0.4.0 #35
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi everyone!
I would like to introduce you the latest version of Amanda (v0.4.0).
First change (and probably the most important) is a change in the direction. Amanda is no longer just a validation library for JSON Schema. It's aiming to be an universal validation library, currently it supports only the JSON Schema Internet Draft, but I'm planning to add Orderly, Relax NG and others very soon.
Example
Compliant with the JSON Schema Internet Draft
Amanda is now more compliant with the JSON Schema Internet Draft. I have added new attributes.
Also the
format
attribute supports all formats defined by the JSON Schema Internet Draft plus some custom formats likealpha
,alphanumeric
,decimal
,percentage
and others.Another notable change is that validators has been renamed to attributes. Instead of calling the
addValidator
method, please use theaddAttribute
method. This changes also applies to theError
object.addValidator
→addAttribute
validator
→attribute
validatorName
→attributeName
validatorValue
→attributeValue
Attributes API
The thing I'm the most excited about is enhanced attributes API. You already know you can add a custom attribute.
An error can be reported by calling the
addError
method.Attributes are more powerful with the new enhanced attributes API. They have an access to the internal API (via
this
keyword).The same applies for internal properties.
this.instance
)this.schema
)Error
object (this.errors
)this.attributes
)Again, all these methods and properties are available under the
this
keyword.Documentation
The documentation has been completely revamped. It could be found in the /docs/ folder. To be noted, the documentation is not complete yet.
Tests
All tests have been rewritten into Mocha in order to test the library in the browser.
Error Messages
More accurate error messages, that's it.
Build
Amanda was separated into multiple files. I hope you and the ‘make’ command get along well.
Conclusion
Although I was trying hard to not break the current API, in some cases it could happen. Please keep this in mind.